/    Sign up×
Community /Pin to ProfileBookmark

New window won’t stop loading

Hi,

I created a page with a form that opens a new window and enters the information from the form in a format that looks better for printing.

It works fine, but when it’s done creating, the browser still keeps “loading”, i.e. the little icon in the upper right corner is still animated as if it were expecting more to come.

Is there a way to send something like an “end of file” command?

I closed all HTML tags properly, and I read that I should put a backslash before the slash in closing tags, but that didn’t work, either.

Here is most of my code (edited because I don’t think the mistake lies in the middle of it where all I do is to add more table data):

[CODE]
function openinvoice() {
invoicewin = window.open(“”,”mywin”,”width=800,height=500,left=0,top=0,location=yes,hotkeys=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes”);

invoicewin.document.write(‘<html><head><title>Invoice</title>n’);

invoicewin.document.write(‘</head> n <body> n’);

invoicewin.document.write(‘<table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”600″> n <tbody><tr> n’);

invoicewin.document.write(‘ <td width=”293″>INVOICE</td> n’);

invoicewin.document.write(‘ </tr><tr> n’);

[…]

invoicewin.document.write(‘<p><strong><font color=”#000099″>THANK YOU FOR YOUR BUSINESS!</font></strong></p> n’);

invoicewin.document.write(‘</body></html>’);

};

// –>
</script>
[/CODE]

Is there something wrong with my script, or am I a missing something else?

Thanks!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@NedalsMay 15.2005 — Try

document.close();
Copy linkTweet thisAlerts:
@semmelbroeselauthorMay 15.2005 — That was it! :-)

I never knew document had the method close, too - I only knew it for window.

Thanks so much!
×

Success!

Help @semmelbroesel spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...