passing javascript variable to php file without page refresh
-
var clickcounts='0'; function count() { clickcounts++; alert(clickcounts); } I like to pass the clickcount value to a php file without page refresh. If AJAX is the only way give me an example Thanks In Advance, Praveen
-
var clickcounts='0'; function count() { clickcounts++; alert(clickcounts); } I like to pass the clickcount value to a php file without page refresh. If AJAX is the only way give me an example Thanks In Advance, Praveen
Member 4514218 wrote:
I like to pass the clickcount value to a php file without page refresh. If AJAX is the only way give me an example
Yes, Ajax is the only way. For the samples, there are many samples in the web, just needs a simple searching. For example : http://forums.tizag.com/showthread.php?p=32989#post32989[^]
-
var clickcounts='0'; function count() { clickcounts++; alert(clickcounts); } I like to pass the clickcount value to a php file without page refresh. If AJAX is the only way give me an example Thanks In Advance, Praveen
AJAX is the way to go if you want to make calls to the server without refreshing the page. It makes XML calls to the server. Here's is a script you can use- http://whatsaranjit.com/includes/grabData.js The variables explained- this.value: variable passed as get variable q ID of div: the id of the div that should be alter to contain the new data page for processing: PHP, .NET, CF, etc page that will process q and return output Take a look and try it out. Thanks.