arrays - Is it possible to send object in url jquery -


data.push({     name: name,     age: age,     address: address,     contactnumber: contactnumber  });  var url = '../reports/student.php?data='+data; window.open(url, '_blank'); 

../reports/student.php?data=[object%20object]

above object want send page can retrieve , use on next page generate report. url looking 1 above not sure if possible , if possible how can value of each data in object.if not possible please point me right direction idea ap

if definetly want use get request, use json.stringify:

var url = '../reports/student.php?data='+ encodeuricomponent(json.stringify(data)); 

but better way post request.

you can use jquery.param():

var data = {   name: 'yourname',   age: 1, }  var params = jquery.param(data) // 'name=yourname&age=1' var url = '../reports/student.php?'+ params; 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -