[RESOLVED]javascript variable inseide php script
I have a problem about the javscript variable inside the php script.
i have a javascript inside the php
<SCRIPT SRC="../javascript/variable.js"></script>
i can use the variable at the frist time example a="my name";, but if i change the variable inside the javascript(variable.js) "a=your name";, my homepage still keep the old javascript's variable a=my name . even i had deleted the variable.js my homepage still using the old variable a=my name. does anyone know how to update the variable by javascript or it is the server problem!
Re: javascript variable inseide php script
I think you are a little muddled.
PHP has nothing to do with JavaScript.
PHP is a purely server-side technology; JavaScript is purely client-side.
No JavaScript variables are persisted after the user navigates away from the page.
Re: javascript variable inseide php script
basically my homepage is html, just the extn is php and have some function used <?php></php> i can use the javascript variable, i feel strange why my homepage keep the variable value even i have change the variable or delete the variable.js , is it the server problem?
Re: javascript variable inseide php script
i find the answer from internet and want to share with other.it is javascript cache problem.
add ?new Date().getTime() at the end of script my problem solved!!
example
<SCRIPT SRC="../javascript/flyingobject.js?new Date().getTime()">