469,270 Members | 1,778 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

window.open not working in IE when trying to write 10,000+ characters

Im having problems getting the window.open function to work properly in internet explorer. The code works fine in firefox, but thats not really an option (cant just force everyone to use that to be able to use the page). anywise, the function im using is as follows:

Expand|Select|Wrap|Line Numbers
  1. function viewallxml(inXML) {
  2.  
  3.     newwindow1=window.open('','name','height=400,width=500,scrollbars=yes,resizable=yes');
  4.     var tmp = newwindow1.document;
  5.     tmp.write('<html><head><title>Input Nodes</title></head><body><font face=arial size=1>');
  6.     tmp.write(inXML);
  7.     tmp.write('</font></body></html>');
  8.     tmp.close();
  9. }
Now im trying to sending the function about 10,000 characters, if i reduce this to a little bit below 3,000 it seems to work fine. Is there some kind of limit for how much text i can send a function in IE? would seem pretty retarded if so, especially since i havent been able to find any documention even hinting at that limitation ... anywise any help would be greatly appreciated, thanks.
Jul 25 '07 #1
7 1456
pbmods
5,821 Expert 4TB
Heya, karamorf. Welcome to TSDN!

I take it, then, that you need to send a lot of variables in the URL of the window. Is this correct?

Perhaps a better way to do this would be to progressively store as much data as possible on the server and then associate that data with the current session (in PHP, for example, the equivalent is storing everything in $_SESSION).

Then you don't have to pass hardly anything in the URL.
Jul 25 '07 #2
im not trying to put anything in the URL, im trying to display alot of data that is in the html page so that when you click the link a window popups with all of the data. the html gets generated by a C# app but i cant use PHP since everything has to be standalone. So in the html i have this:

[HTML]<A HREF="javascript:viewallxml(' some 10,000 characters ') "/>[/HTML]

the link works fine when the text size isnt so big but once it gets above 3,000 or so the link fails to do anything, no error message, just doesnt do anything when clicked.
Jul 25 '07 #3
pbmods
5,821 Expert 4TB
Ah. I see now what you're getting at.

Why not just have the window open the page that calls the C# app that generates the content?
Jul 25 '07 #4
Sorry, i was been specific enough ... the C# app generates one large html page, all of the data that i want displayed in the popup is in the one html page ... if i was to make it so each popup had its own html page there would probably be 1,000's of pages generated per day, a rather large number of files to manage for a feature that probably would not be worth managing that many files.
Jul 25 '07 #5
pbmods
5,821 Expert 4TB
I'm not sure I understand. How many times per page load is the pop-up window getting opened? Does it really save that much of a load on your server to cache the HTML client-side versus regenerating the HTML every time the pop-up is opened?

Alternatively, you could set up a server-side cache, though I would imagine that may be overkill for your app.
Jul 25 '07 #6
There is no webserver for these pages, i suppose that might have been an important detail to mention. they are generated and put onto just a network share.

After messing around with it a little bit ive realized one more thing though, it seems that the function just doesnt get called if the text size is to large. I found this out by making a global variable in the JS that was well voer the 3000 characters and it work fine being written into the new window, but taking that same string and sending it to viewAllXML from the html had the result of not working.

did one other thing that might help, if i add an alert to the begging of the function the alert will work fine when the text size is below this magically 3000 number. but when i increase the size of the input text the alert doesnt even get triggered, which leads me to believe IE has some limit on the amount of text you can send to a JS function.
Jul 25 '07 #7
pbmods
5,821 Expert 4TB
Will it work then if you assign the huge string to a variable and pass the variable to viewAllXML()?
Jul 25 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Jawahar Rajan | last post: by
3 posts views Thread by Michael | last post: by
9 posts views Thread by Justin Koivisto | last post: by
14 posts views Thread by D. Alvarado | last post: by
4 posts views Thread by astromac | last post: by
4 posts views Thread by alexandre.brisebois | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.