JustinM01 Posted April 16, 2007 Share Posted April 16, 2007 OK, I have a PHP calendar function that displays all the posts for the current year (when the page loads). I have arrows that allow the user to change which year to display. I'm trying to use AJAX so the page wouldn't have to be reloaded. I have it setup like this: Calendar page -> Javascript js file -> PHP handling script The handling script creates a new calendar object and initializes it to the requested year. The problem is that the two objects are not referencing the same object, so a user can only decrease the calendar date to 2006 or increase it to 2008 because every time the original page loads the calendar initializes to 2007. I don't have a problem passing variables from the original page through javascript and to the handling php script, but I do in the reverse direction. I currently call the javascript function from an onClick event in a link. Is there something I'm not seeing, or will the way I'm currently doing it not work and is there another way I should look at? ??? Thanks. Link to comment https://forums.phpfreaks.com/topic/47182-passing-javascript-variables-to-php/ Share on other sites More sharing options...
kenrbnsn Posted April 16, 2007 Share Posted April 16, 2007 The only way Javascript can communicate with PHP without a page reload is using AJAX. Ken Link to comment https://forums.phpfreaks.com/topic/47182-passing-javascript-variables-to-php/#findComment-230090 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.