jquery change load get url
Posted
by john morris
on Stack Overflow
See other posts from Stack Overflow
or by john morris
Published on 2010-04-14T23:03:41Z
Indexed on
2010/04/14
23:23 UTC
Read the original article
Hit count: 316
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?
© Stack Overflow or respective owner