I added some debug code to my php file, so that it will give a value of -1 to it's $campname variable if it can't find anything in $_GET. I've tried these:
var campName = 'NewCourse'; $('#table').load("camp_table2.php",{Title:campName}); returned value is -1 (didn't get the Title:Coursename pair from $_GET) $('#table').load("camp_table2.php",{Title:"NewCourse"}); returned value is -1 (didn't get the Title:Coursename pair from $_GET) $('#table').load("camp_table2.php",{"Title":"NewCourse"}); returned value is -1 (didn't get the Title:Coursename pair from $_GET) I wish I understood $_GET better. Is there a way that I can watch the value of $_GET while I'm debugging? On Apr 18, 1:19 pm, Scott Sauyet <[EMAIL PROTECTED]> wrote: > duggoff wrote: > > I've gone through the tutorial for Quick and Dirty Ajax (http:// > > 15daysofjquery.com/quick-and-dirty-ajax/14/) and I'm having a problem. > > I have a php file that queries a database and returns a populated > > table. If I call it from my browser like this: camp_table.php? > > Title=Campname it get a web page with the populated table. I want to > > use this code: $('#table').load("camp_table2.php"{key:value}); but I > > can't figure out how to format the key:value pair. ?Title=Campname > > doesn't work, and everything else I've tried also fails. If I leave > > off the key:value pair, the whole thing works but gives me an empty > > table (of course). > > Have you tried > > $('#table').load("camp_table2.php",{"Title": "Campname"}); > > or, more realistically, > > var campName = /// smething here > $('#table').load("camp_table2.php",{"Title": campname}); > > ? I think that should work. > > The key: value pairs are the names and values of any parameters you want > to pass to the server in the query, so if your url looked like > > shirt.php?size=XL&color=white&fabric=cotton > > then your call would look like { > > $("#myDiv"").load("shirt.php", { > size: "XL", > color: "white", > fabric: "cotton" > }); > > Good luck, > > -- Scott