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