javascript on osx

S

steve

Hi guys,

I have a problem with the Safari browser.


specifically the following javascript will not print any headings until
after the JS has executed.


<script type = "text/javascript">
document.clear();
document.writeln("<h1>hi there</h1>");
prompt('hello','');
</script>


on safari , the user only sees the user prompt until they press accept.

but on fire fox the heading is rendered then the user sees the input box.


any ideas how to force the safari to render before the prompt.

Steve
 
P

Peter Michaux

Hi guys,

I have a problem with the Safari browser.

specifically the following javascript will not print any headings until
after the JS has executed.

<script type = "text/javascript">
document.clear();
document.writeln("<h1>hi there</h1>");
prompt('hello','');
</script>

<script type="text/javascript">
document.clear();
document.writeln("<h1>hi there</h1>");
setTimeout(function(){prompt('hello','');},10);
</script>

I think there are other issues you probably need to worry about like
why you are doing something this way but the above will probably
answer your question.

Peter
 

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,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top