jquery change load get url
- by john morris
Ok so I have a php page with data dynamically outputs depending on a $_GET variable ['file']. I have another page (index.php) which has a jQuery script that uses the load() function to load the php page. I have a list of links and when you click on one, it needs to change the $_GET variable to load, then refresh the load() jQuery variable. Heres a snippet:
$("#remote-files").load("data.php?file=wat.txt");
$(".link1").mousedown(function() {
$("#remote-files").load("data.php?file=link1.txt");
});
As you can see it loads the data into a div with the ID of remote-files. Is there a better way to do this, like update the page with the new get variable instead of redefining a new load function?