I am sure there is a simple answer to this, but I am drawing a blank at the moment, any suggestions pointers would be great.
I have a php page [ lets say counter.php] which when called [loaded/viewed] it connects to a db and increments a counter. I also have another page that has a selects box, I want to add a .js function on the onchange event that will call/poll the counter.php file thus incrementing the counter.
Is there a way to call or poll and file/page from .js, i know that this can be done via a HttpRequest but this seems like overkill as i don't want to return anything or change anything on the page.
thanks in advance
.k
Thanks for your answers, but maybe I wasn't clear, I don't want to return anything or change anything on the page, I just want to poll the page. I am looking for a simpler way to do so without resorting to ajax/iframe.
Here is an example of what I have:
counter.php
<?php
// connect to db
// increment counter val
// DOES NOT RETURN ANYTHING
?>
index.html
<script>
increment()
{
// I Just need to poll the page [counter.php] here,
// thus incrementing the counter, ie no change on this page !
};
</script>
<select onchange="increment();"> ... </select>