Is this code right?

M

Mark Smith

I have the following function that is supposed to create a popup help
window and fill it with some text:

function showHelpText(text)
{
win=window.open('/help/
help.html','','width=900,height=400,scrollbars=1');
var e=win.document.getElementById('help');
if(e!=null)
{
e.innerHTML=text;
}
}


The help.html file is as follows:
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
</head>
<body style="background-color:#ffffdd;font-family:verdana;font-size:
10pt;">
<div id="help"></div>
</body>
</html>

Calling showHelpText('<p>TEST</p>'); works from IE6+7. But in FF3 the
popup window is displayed but remains empty...

Here's the kicker: If I put a breakpoint in the function using firebug
and step though one line at a time it behaves as expected!

Any idea what's going on?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,102
Messages
2,570,645
Members
47,245
Latest member
ShannonEat

Latest Threads

Top