Is there any way to get pass the variables from one php page to another using javascript and get the the output of it without loading the page?? Note that variables should pass only using javascript. I
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you really want to avoid using PHP you can try 3 methods:
1. Cookies
This is easyest and most relyable method. But be aware – user can edit and view data. You should google yourself some articles about that, tahie this one (http://www.quirksmode.org/js/cookies.html) for starter to understand the topic.
2. Local storage
Some browsers may have this utility disabled or not implemented at all. Advantage of this is, that, unlike cookies, this data are not sent with HTTP request headers so you can save some traffic.
Google again. There is nothing I can tell you about theese what google can’t.
3. Passing variables between windows
This only works for very specific case – when you have two windows and one of them is opened via
window.open()function. This function returns new window handle.But still you should consider using AJAX to save variables on server and retrieve them from here.