Bala Krishnan
Bala Krishnan

Reputation: 25

how to redirect a page in javascript with passing values to another page

window.location="http://test.rgniyd.com/test1/?q=node/36/"&dept="+ dept +"&bath="+  
bat +"&month=+month+"&year="+year+"&semester="+sem";

how to redirect the page to http://test.rgniyd.com/test1/?q=node/36/ with values in
JavaScript. the above code is not working , please help or please suggest me how to redirect page without clearing the session values in JavaScript

Upvotes: 0

Views: 1147

Answers (2)

Naveen Kumar Alone
Naveen Kumar Alone

Reputation: 7678

Change your JavaScript as

window.location="http://test.rgniyd.com/test1/?q=node/36/&dept=" + dept + "&bath=" + bat + "&month=" + month + "&year=" + year + "&semester=" + sem;

Because you have misplaced double quotes "

Upvotes: 1

Gabriele Petrioli
Gabriele Petrioli

Reputation: 196286

You have messed up (a bit) the string concatenation..

window.location="http://test.rgniyd.com/test1/?q=node/36/&dept="+ dept +"&bath="+  
bat +"&month="+month+"&year="+year+"&semester="+sem;

Upvotes: 0

Related Questions