window.open arguments

  • killercelery
  • Newbie
  • Newbie
  • killercelery
  • Posts: 13
  • Loc: Montréal, Québec

Post 3+ Months Ago

Is it possible that the javascript function window.open has length limited arguments : window.open(file_name, window_name, param_array)

my window_name and param_array arguments are fine cause my call worked a couple days ago but, now that my file_name argument is much longer, and error occurs on this function call. (Invalid pointer)

I guess the length of file_name is about 8000 chars. As you might guess, the reason it's that long is that I send a very long querystring with the file name.

If it's a length problem, anyone knows how I could send a SQL request on the web server and get the resulting data without calling another window?
Any help is appretiated.

try{succedd();} catch(E) {tryharder();}
-killercelery
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Yeah eventually there is probably going to be a limit, and 8000 sounds pretty huge. Is there a certain reason you have to use javascript to open the new window in this case? Will regular HTML not work?

If you really want to use the JavaScript to open the window you might consider using it with a POST request instead of a GET request. Not sure if you might be able to get more data into your query that way.
  • killercelery
  • Newbie
  • Newbie
  • killercelery
  • Posts: 13
  • Loc: Montréal, Québec

Post 3+ Months Ago

the post method allows more chars but I don't think I can use it cause I'm not retreiving data from a form. I open a window with parameters for a SQL query (I specify the select...from...where...). then, the asp page opened in the new window executes the query on the server and sends back the fields values to the parent window.

I did find a way to do it, thought it isn't nice...
The bigest parameter was the "From" of the query, so I put it in a Session variable instead and send the rest in the querystring. that way, the querystring is about 100 chars long and everything works fine, but like I said, it ain't pretty.

by the way, microsoft says the max length of a querystring is 8043 chars. it's not a usual limit but...
I guess my querystring was like 8045 chars...LOL
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Well at least you got it to work. Are you sure specifying the sql query the way you are is the safest thing to do? Would it be possible for someone to abuse that?
  • killercelery
  • Newbie
  • Newbie
  • killercelery
  • Posts: 13
  • Loc: Montréal, Québec

Post 3+ Months Ago

I think it's safe, there's a user login on the first page and then every page called after validates if a user is logged and if that user has access rights on the page he's trying to open.
Of course, this validation is ASP so the user can't see the source...
  • joeposter649
  • Born
  • Born
  • joeposter649
  • Posts: 1

Post 3+ Months Ago

I'm having the same problem with a popup that passes SQL to do a query. If I can find the time I'm going to change it to use XMLHTTP.
http://www.w3schools.com/xml/xml_http.asp

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 89 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.