Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 3rd, 2006, 09:59 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default javascript popup keeps loading

Hi could somebody tell whats wrong in the following script this popup keeps loading when showed


<script language='javascript'>
var newwindow;
newwindow=window.open('name','height='+lngHeight+' ,width='+lngWidth+'left=0,top=0,resizable=no,scrol lbars=no,toolbar=no,status=yes');
newwindow.document.write('<head><title>Link</title><style>input{width:700px;}</style></head><body topmargin=0 leftmargin=0 scroll="&chr(34)&"no"&chr(34)&"><input type=text value="default;">');
</script>

__________________________________________________ ________
This is my junk I'm gona eat it
 
Old January 3rd, 2006, 10:08 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Shouldn't the first argument to open be a URL or an empty string?

I'm not sure what "keeps loading means" but after finishing writing the HTML, and closing the body and html elements you should call document.close():
Code:
newwindow.document.close();
--

Joe (Microsoft MVP - XML)
 
Old January 3rd, 2006, 10:22 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you
newwindow.document.close(); did the trick

and yes it was a bit sloppy the html and body needed to be closed

__________________________________________________ ________
This is my junk I'm gona eat it




Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript popup does not stay on top billbillbill Classic ASP Basics 0 July 23rd, 2007 12:15 PM
Javascript in popup. rupen Javascript 0 April 27th, 2006 08:34 AM
Popup window from javascript arnabghosh Javascript How-To 1 March 2nd, 2006 10:17 AM
Popup window from Javascript arnabghosh Javascript 3 March 1st, 2006 01:09 AM
Javascript popup window with ASP variable johnnycorpse Classic ASP Databases 2 February 24th, 2005 01:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.