melting_dog Posted June 4, 2012 Share Posted June 4, 2012 Just wondering does anyone know how to use JQuery or JavaScript to store JavaScript Vars in a JSON file? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/263628-storing-javascript-variables-in-json-file/ Share on other sites More sharing options...
trq Posted June 4, 2012 Share Posted June 4, 2012 You cannot write to a file using client side JavaScript. What exactly are you trying to achieve? Quote Link to comment https://forums.phpfreaks.com/topic/263628-storing-javascript-variables-in-json-file/#findComment-1351064 Share on other sites More sharing options...
melting_dog Posted June 4, 2012 Author Share Posted June 4, 2012 You cannot write to a file using client side JavaScript. What exactly are you trying to achieve? Thanks for the reply. Basically, I am trying to transfer some data from one site to another, like how the Twitter API does. My goal is to have other sites updated from one, central site. Would I have to use PHP to achieve this? Quote Link to comment https://forums.phpfreaks.com/topic/263628-storing-javascript-variables-in-json-file/#findComment-1351075 Share on other sites More sharing options...
trq Posted June 4, 2012 Share Posted June 4, 2012 well you can't create files using is. some server side language would be best. Quote Link to comment https://forums.phpfreaks.com/topic/263628-storing-javascript-variables-in-json-file/#findComment-1351094 Share on other sites More sharing options...
melting_dog Posted June 5, 2012 Author Share Posted June 5, 2012 Cool got it. Havent really solved the problem but I now know I must use PHP to encode the JSON on the server side. Then I can use JQuery to read the PHP from the server. Quote Link to comment https://forums.phpfreaks.com/topic/263628-storing-javascript-variables-in-json-file/#findComment-1351517 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.