I have a javascript function in which I want to open a new window and display some data. The problem is I am sending an array of ID’s to my action and I do not want to append them to the URL as I can simply pull it as a request paramiter in my action. The logic is as follows.
$.get('${studentidurl}', {"registrationIDs[]": rowids}, function(data){
window.open(data);
return false;
});
This DOES NOT WORK as window.open(); does not allow for passing additional paramiters to the given URL.
Is there a way to send accross paramiters using window.open() like we would pass paramiters using jquery $.get(...params go here...) ?
Yes, you can specify query string in page directly:
Here
var1andvar2with their values are passed topage.htmlpage as an example. You can add as many such name-value pair query string variables as you want. If the values contain spaces or other special characters, then you will have to useencodeURIComponent()function.