Javascript Subs

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

this is my code:

ResultWin.document.write("<html><head></head><body style='margin:0px;' onload='setTimeout(???this.close???,4000)>');
'

It is a part of a function that opens a window (ResultWin) and after 4 seconds it should close it.

The protocol of the setTimeout demands its action (this.close) to be quoted. But what do I put there at position of the question marks?

In other words: how to get a third level substring?

Thanks a lot Smiling

Shakespeare: onclick || !(onclick)

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

Found it:

escape character is the backslash Smiling

They have: 93 posts

Joined: Jun 2003

if you would have done Onload="" versus Onload='' you would not of had that problem.

NM, forgot it was in a JS string already. yes in that case you must use \' \'

[Design Alpha] -Web Services : Design,Hosting,Advertising,Software
Ask about custom pricing on hosting!!
Site Assets: [UltraGaming.com] [Blades of Warcraft]

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.