Page 1 of 1

Text Message From Local Storage

Posted: Wed Jun 08, 2016 3:02 pm
by Nick Pitt

Hi

Please can you help me with this i want to send a text message based on the phone number in local storage.

var ConNum = localStorage.getItem("ContactNumber");
var Message = localStorage.getItem("Message");

window.open('sms: ConNum?body=Message', '_system');

Thanks in advance

Nick


Text Message From Local Storage

Posted: Thu Jun 09, 2016 8:44 pm
by Illya Stepanov

Hi Nick -

You will need to prepare the string first to be able to use it with .open() method.

Something like this:

precode
var ConNum = localStorage.getItem("ContactNumber");
var Message = localStorage.getItem("Message");
alert(ConNum);
alert(Message);

var str = "sms:+"+ConNum+"?body="+Message+"&quot
alert(str);

window.open(str, "_system");
/code
/pre


Text Message From Local Storage

Posted: Fri Jun 10, 2016 11:10 am
by Nick Pitt

Excellent response, works well.

Thanks Illya.