All the other AJAX examples I have read involve moving data, using html elements and code for older versions of browsers and are not helping me achieve what I want.
I simply need to call a PHP file from JavaScript when a certain condition is met, there is no action and no data returning/moving. What is the most simple way of calling this php file? I also want to try to avoid using jquery if possible.
if( condition is met)
{
// call the PHP file
}
else
{
// other logic
}
I'd love to see the "simplest" answer. Because the easiest one is jquery.
$.post('yourpage.php',{
var1 : 'something',
var2 : 'somethingelse'},
function(return){
//do something
})
What is eaier?
If AJAX and Jquery are out of the options list you may use an iframe.
if(condition)
{
document.getElementById('iframeId').src = 'page.php'
}