The &
character should be inside quotes and not outside quotes. This is the corrected code :
$("#list").load("selectcity.php?city1="+city1+"&area1="+area1);
$.ajaxSetup({ cache: false });
GET parameters are separated by the character &
. You are passing 2 parameters to the file separated by &
. The ?
sign in the URL indicates that the next characters coming after it is the GET
parameters.
Or you can use $.get
which is very easy to set up and works fine like $.load
:
$.get("selectcity.php", {"city1": city1, "area1": area1}, function(response){
$("#list").html(response);
});