HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 3rd, 2008, 07:38 AM
brent brent is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 5 brent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 22 m 37 sec
Reputation Power: 0
Document.write page size limit?

Sorry if this has been addressed in the past, but I'm new to this forum. I'm having a problem with what appears to be a character limit on document.write usage. The following, simple code snippet works, but if 1 or more characters are added to the text (list of dashes), then the popup box does not work. This seems to be the case in IE, but not in firefox.

Does anyone know a way around this for IE?

Thanks!

Code:
<html><head>
<SCRIPT language="javascript">
function openPage(pageHtml) {
var newWin = window.open("","","width=600,height=420,scrollbars=yes,left=300,top=0  ");
newWin.document.open();
newWin.document.write(pageHtml);
newWin.document.close();
}
</script>
</head>
<body>
<table>
<tr><td>Test Link</td><td><a
href='javascript:openPage("<html><body>
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
--------
")'>
<u>Click Here</u></a></td></tr>
</table>
</body></html>

Reply With Quote
  #2  
Old July 3rd, 2008, 08:14 AM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Mar 2005
Location: I used to live at home, now I stay at the house
Posts: 3,358 ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 1 Month 1 Week 3 Days 5 h 53 m 37 sec
Reputation Power: 291
Facebook
Can I just ask why you are using JavaScript to build an entire page
like that anyway? Surely it would be easier to just build the page
in HTML, open it, and use script to manipulate it accordingly...
__________________
Support requests via PM will be ignored!
Route of Queue | The General FAQ Thread | HOW TO POST A QUESTION

Sign up with Matched.co.uk and earn up to £15 per website every month!


Reply With Quote
  #3  
Old July 3rd, 2008, 08:17 AM
brent brent is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 5 brent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 22 m 37 sec
Reputation Power: 0
No particular reason, I originally had it all in HTML, then just tried to see if putting the code in javascript would make a difference. No luck, though.

Reply With Quote
  #4  
Old July 3rd, 2008, 10:13 AM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Mar 2005
Location: I used to live at home, now I stay at the house
Posts: 3,358 ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 1 Month 1 Week 3 Days 5 h 53 m 37 sec
Reputation Power: 291
Facebook
I wouldn't have thought doing it in JS would be a good idea.

You are quite likely to run into some issues with escaped quotes.

Reply With Quote
  #5  
Old July 3rd, 2008, 10:17 AM
brent brent is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 5 brent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 22 m 37 sec
Reputation Power: 0
Yeah, escaped quotes have definitely been a problem.

Looks like it might be a limit of 860 characters per write or writeln call. I'm going to try to split into multiple calls.

Reply With Quote
  #6  
Old July 3rd, 2008, 12:36 PM
brent brent is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 5 brent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 22 m 37 sec
Reputation Power: 0
okay, now it looks like it's a limit on the number of characters in the href attribute. Not sure where I got 860 from above, it's really more like 2082.

Reply With Quote
  #7  
Old July 3rd, 2008, 12:40 PM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Mar 2005
Location: I used to live at home, now I stay at the house
Posts: 3,358 ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)ChiefWigs1982 User rank is Captain (20000 - 30000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 1 Month 1 Week 3 Days 5 h 53 m 37 sec
Reputation Power: 291
Facebook
Move it out of the href attribute then.
Code:
<a href="javascript:;" onclick="functionCall('...');">...</a>

Reply With Quote
  #8  
Old July 3rd, 2008, 01:35 PM
brent brent is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 5 brent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 22 m 37 sec
Reputation Power: 0
after looking around, the problem is the URL length limit in IE is 2083 characters.

Found link on Microsoft site (Help and Support), but can't show it here as I am being blocked from doing so.

thanks for the responses!!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Document.write page size limit?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway