I have an php variable like this:
$pageClass = 'cube';
And I want to be able to change this variable with jQuery and the jQuery is on the same page? Can this be done???
Thanks in advance
I have an php variable like this:
$pageClass = 'cube';
And I want to be able to change this variable with jQuery and the jQuery is on the same page? Can this be done???
Thanks in advance
jQuery (which is JavaScript code) doesnāt start to run until PHP has fully finished.
So what if i Want to change an variable in a iframe. In the page within the iframe lets say from an dropdown menu with an āonChangeā?
By the time the page gets to the web browser, all of the PHP code has long since been executed.
If you want PHP to behave differently based on different inputs, you will need to send that info as a request to the server.
That can be done either by sending the data to a request for a new page (commonly by submitting a form request), or it can be done as a partial part of the page without reloading the page by using an AJAX request.
Thereās a good book that takes you through how to do such things properly, called Bulletproof Ajax
Thanks alotā¦ Iām on it