0

I'm using jquery's .load function to load a page in a container , but I need to pass some parameters with the url, javascript variables hold the value of the parameter

    var data = "xyz";
$("#toggleText").load("inner/playlist.php",{name:data});
Neshnt Wsm
  • 3
  • 1
  • 6

1 Answers1

1

its always good idea to use quotes for the param names.

$("#toggleText").load("inner/playlist.php",{'name':data});

also, try to put the callback function to check it it actually does anything:

$("#toggleText").load("inner/playlist.php",{'name':data}, function(response, status, xhr) {
if (status == "error") {
    alert("Error: " + xhr.status + " " + xhr.statusText);
  }
});
whiteagle
  • 1,158
  • 10
  • 12