473,385 Members | 1,645 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Is there any way to create a modal dialog in the html


Is there any way to create a modal dialog in the html, which should work
in both ie and netscape.
the one window.showmodaldialog works well in ie, but not in netscape

i found a way to keep the window to setfocus like this

<script>
function SetFocusOnMe () {
this.SetFocus ();
setTimeout("SetFocusOnMe()", 50);
}

</script>

</head>

<body onLoad="javascript:setTimeout('SetFocusOnMe()', 50)">

but this gives javascript error

with regards
Balaji
Jul 23 '05 #1
3 1459
Balaji M wrote:

Is there any way to create a modal dialog in the html, which should work
in both ie and netscape.
the one window.showmodaldialog works well in ie, but not in netscape

i found a way to keep the window to setfocus like this

<script>
function SetFocusOnMe () {
this.SetFocus ();
If you do this in Firefox, you get a message saying:

Error: this.SetFocus is not a function
Source File:
...
Line: 8

which is pretty self explanatory - SetFocus is not defined
anywhere as a JavaScript function.
setTimeout("SetFocusOnMe()", 50);
}

</script>

</head>

<body onLoad="javascript:setTimeout('SetFocusOnMe()', 50)">
No need for "javascript:".

So you call setTimeout every 50 ms from here, then again every
50ms from inside the function - cool.

but this gives javascript error


Even if it didn't, and it's trivial to fix, what's the point?
The user can simply close your "modal" window. Or if they have
Firefox (and maybe a number of other browsers), prevent you from
setting focus on it at all.

And if they have scripting disabled, your narcissistic 'dialog'
will not be able to be an attention hog at all. What purpose
does a modal dialog have in the context of a web browser?
--
Fred.
Jul 23 '05 #2
Fred Oz wrote:
Balaji M wrote:


<--snip-->
setTimeout("SetFocusOnMe()", 50);
}

</script>

</head>

<body onLoad="javascript:setTimeout('SetFocusOnMe()', 50)">

No need for "javascript:".

So you call setTimeout every 50 ms from here, then again every
50ms from inside the function - cool.


No. The onload calls it once, then the function calls itself to invoke
after 50 millliseconds. setTimeout only makes one call, setInterval
makes repeated calls (which is what I think you were thinking about
instead of setTimeout).

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #3
Randy Webb wrote:
[...]
No. The onload calls it once, then the function calls itself to invoke
after 50 millliseconds. setTimeout only makes one call, setInterval
makes repeated calls (which is what I think you were thinking about
instead of setTimeout).


Ah yes, post in haste, repent at leisure...

--
Fred
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gilles T. | last post by:
Hi, How I can refresh a modal dialog in asp.net? I open a modal dialog in first with a dropdownlist. To add a element in my dropdownlist (table), I open a second modal dialog to ask element and...
2
by: Joe | last post by:
Is there a way to enable scrolling in a modal dialog box even if the call to open the modal has "scroll:no"? I am looking to dynamically size the modal dialog box for starters and if the modal is...
3
by: Gretjns | last post by:
I'm trying to figure out this script doesn't display any text in the child window and why I'm getting the null or not an object error. It's taken directly from the Javascript and DHTML cookbook...
3
by: tungchau81 | last post by:
Hi, A Modal Dialog does not allow us to highlight the text content inside <DIV> tag unless I use a <textarea> tag to display that text content. However, the situation of my software makes it...
2
by: Ricky K. Rasmussen | last post by:
Hi NG, We have a rather large ASP.NET application that uses popups to display various dialogs to the user. In our work we've come over a rather annoying "bug": If we open a modal dialog using...
10
by: Guadala Harry | last post by:
I have a modal dialog that currently does all of the following except item 4. 1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a...
3
by: mccoyn | last post by:
When I have a long process to run I can create a new thread to run it and create a modal dialog on my GUI thread. The modal dialog prevents any messages (like button clicks) from working on my...
1
by: mikeh3275 | last post by:
I'm new to developing in jQuery, so I'm probably doing this wrong. I'm loading a form into a modal dialog box and I'm trying to assign a click event to the button in the form, but I can't seem to...
2
by: diogenes | last post by:
I have created many shortcut/popup (aka context, or right-click) menus for my application - instead of toolbars or standard drop-down menus. Within my custom menu, I am using...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.