Activate another script in the background!

I’m trying to figure out how to activate another script using jquery and send some variables to this, but cant seem to get a start…

I don’t need any feedback from the script, just want to run it. Here is where I have started:

var url = "2.php?test=mig";
$.ajax({
	type: "POST",
    url: url,
    data: ''
});

I’m not sure this is the right way… Please help :slight_smile:

Have you looked for errors in your browser console? See the following for debugging tools

Firefox - Firebug (Downloadable Extension)
Chrome - Web Inspector (Native - F12)
Safari - Web Inspector (Native - F12)
IE - Development Tools (Native - F12)
Opera - Dragonfly (Native - F12)

You don’t need jquery to do this. http://www.sitepoint.com/forums/showthread.php?135179-Javascript-Refresh. You don’t need the return true; at the end and you’d only need 2 script elements if you want to send requests asynchronously. Only one will suffice as JavaScript is kept in memory even though the element that it loaded from has been changed. Just change the URL to a php one and make sure the header of the php is set to output as JavaScript. If the returned script is dynamic you’ll also need either a no-cache header or add a timestamp to the querystring