Someone kindly helped me with storing data into local storage by showing me a sample jsfiddle code: https://jsfiddle.net/adeneo/2uod274d/However when I try to run the code in my phonegap (using Xcode, building app for iOS), the code doesn't work at all. Anyone have any ideas why? I've included <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script> but still doesn't work.
--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Kerry,
- Connect your device to your mac,
- enable web inspector and
- check if your code gives you some error.
2016-09-18 4:55 GMT+02:00 Kerry Fang <fangy...@gmail.com>:
Someone kindly helped me with storing data into local storage by showing me a sample jsfiddle code: https://jsfiddle.net/adeneo/2uod274d/--However when I try to run the code in my phonegap (using Xcode, building app for iOS), the code doesn't work at all. Anyone have any ideas why? I've included <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script> but still doesn't work.
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.js"></script>
<script type="text/javascript">
document.addEventListener("deviceready",onDeviceReady,false);
function onDeviceReady() {
document.getElementById("btnSave").addEventListener("click",saveData,false);
document.getElementById("btnShow").addEventListener("click",showData,false);
}
function saveData(){
var data = window.localStorage.getItem("date");
var dates = data ? JSON.parse(data) : [];
dates.push( new Date() );
window.localStorage.setItem("date", JSON.stringify(dates));
alert("Your data is stored");
}
function showData() {
var data = JSON.parse(window.localStorage.getItem("date"));
console.log(data);
$('#res').html(JSON.stringify(data));
$(this).html('Update result');
}
</script>
HTML: <button id="btnSave"> Save Data </button>
<button id="btnShow"> Show Data </button>
function saveData()
{ var date= new Date();
window.localStorage.setItem("date", JSON.stringify(date));
alert("Your data is stored");
}
Hi Kerry,
- Connect your device to your mac,
- enable web inspector and
- check if your code gives you some error.
2016-09-18 4:55 GMT+02:00 Kerry Fang <fangy...@gmail.com>:
Someone kindly helped me with storing data into local storage by showing me a sample jsfiddle code: https://jsfiddle.net/adeneo/2uod274d/--However when I try to run the code in my phonegap (using Xcode, building app for iOS), the code doesn't work at all. Anyone have any ideas why? I've included <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script> but still doesn't work.
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Kerry,
- Connect your device to your mac,
- enable web inspector and
- check if your code gives you some error.
2016-09-18 4:55 GMT+02:00 Kerry Fang <fangy...@gmail.com>:
Someone kindly helped me with storing data into local storage by showing me a sample jsfiddle code: https://jsfiddle.net/adeneo/2uod274d/--However when I try to run the code in my phonegap (using Xcode, building app for iOS), the code doesn't work at all. Anyone have any ideas why? I've included <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script> but still doesn't work.
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe@googlegroups.com.