javascript - Passing Multiple Variables to a PHP page -


i want pass multiple variables city1 , area1 (javascript variables) in url php page got stuck in on part shown below. doing wrong?

$("#list").load("selectcity.php?city1="+city1&"area1="+area1); $.ajaxsetup({ cache: false }); 

the & character should inside quotes , not outside quotes. corrected code :

$("#list").load("selectcity.php?city1="+city1+"&area1="+area1); $.ajaxsetup({ cache: false }); 

get parameters separated character &. passing 2 parameters file separated &. ? sign in url indicates next characters coming after get parameters.

or can use $.get easy set , works fine $.load :

$.get("selectcity.php", {"city1": city1, "area1": area1}, function(response){  $("#list").html(response); }); 

Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -