Mr world wide
Mr world wide

Reputation: 4814

How can i send two parameters using ajax url

i am trying two send two values to new page i am new to jquery how can i concatinate them:

The Error is in location line ('')

here my ajax code:

success: function (response) {
if(response["success"]==true)
{
    $("#showMessage").html(response['message']);
    location = '/learningcurve/gdpi.php?jobid=='+response["id"]'&jobname=='+response["jobname"];
     window.open(location);

enter image description here

Upvotes: 1

Views: 36

Answers (2)

Nitin Kumar
Nitin Kumar

Reputation: 898

try this one

success: function (response) {
if(response["success"]==true)
{
    $("#showMessage").html(response['message']);
    location = "/learningcurve/gdpi.php?jobid="+response["id"]+"&jobname="+response["jobname"];
     window.open(location);

Upvotes: 1

StackSlave
StackSlave

Reputation: 10627

You forgot to concatenate:

'+response["id"]+'

Notice the +.

Upvotes: 1

Related Questions