By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,045 Members | 1,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,045 IT Pros & Developers. It's quick & easy.

ie7 problem

P: n/a
Bob
Hello,

The following function is failing in ie7. Can anyone offer a solution?
function pause(numberMillis) {
if (IEVERSION >= 5.5) {
var dialogScript = 'window.setTimeout(function () {
window.close(); }, ' + numberMillis + ');';
var result =
window.showModalDialog('javascript:document.writel n("<script>'+dialogScript+'</script>")');
}

Nov 22 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a

Bob wrote:
Hello,

The following function is failing in ie7. Can anyone offer a solution?
You have not given a context in which you are trying to achieve with
the code given.
function pause(numberMillis) {
if (IEVERSION >= 5.5) {
How are you obtaining the version number? Is it even reliable?
var dialogScript = 'window.setTimeout(function () {
window.close(); }, ' + numberMillis + ');';
var result =
window.showModalDialog('javascript:document.writel n("<script>'+dialogScript+'</script>")');
Generally good practice to place a type attribute:

<script type = "text/javascript">

The string '</script>' is causing the browser to think that this is
where the script actually ends. Escape the slash:

<\/script>

Nov 22 '06 #2

P: n/a
Bob
Thanks for your reply. Th IEVERSION variable is set in another area.
It does seem to work ok. The problem I'm having with the code is that
it infinitely executes. By that I mean, it is being called repeatedly
(like a sleep function) to allow form field processing to be handled.
Problem only on ie7.

web.dev wrote:
Bob wrote:
Hello,

The following function is failing in ie7. Can anyone offer a solution?

You have not given a context in which you are trying to achieve with
the code given.
function pause(numberMillis) {
if (IEVERSION >= 5.5) {

How are you obtaining the version number? Is it even reliable?
var dialogScript = 'window.setTimeout(function () {
window.close(); }, ' + numberMillis + ');';
var result =
window.showModalDialog('javascript:document.writel n("<script>'+dialogScript+'</script>")');

Generally good practice to place a type attribute:

<script type = "text/javascript">

The string '</script>' is causing the browser to think that this is
where the script actually ends. Escape the slash:

<\/script>
Nov 22 '06 #3

P: n/a
Bob
I believe that I've isolated the problem to showModalDialog. Is this a
known problem with ie7? Is there an alternative to showModalDialog?
Thanks.
Bob wrote:
Thanks for your reply. Th IEVERSION variable is set in another area.
It does seem to work ok. The problem I'm having with the code is that
it infinitely executes. By that I mean, it is being called repeatedly
(like a sleep function) to allow form field processing to be handled.
Problem only on ie7.

web.dev wrote:
Bob wrote:
Hello,
>
The following function is failing in ie7. Can anyone offer a solution?
You have not given a context in which you are trying to achieve with
the code given.
function pause(numberMillis) {
if (IEVERSION >= 5.5) {
How are you obtaining the version number? Is it even reliable?
var dialogScript = 'window.setTimeout(function () {
window.close(); }, ' + numberMillis + ');';
var result =
window.showModalDialog('javascript:document.writel n("<script>'+dialogScript+'</script>")');
Generally good practice to place a type attribute:

<script type = "text/javascript">

The string '</script>' is causing the browser to think that this is
where the script actually ends. Escape the slash:

<\/script>
Nov 22 '06 #4

P: n/a
It's not a problem. This script is a hack. I'm sure they tightened it
up in ie7. We'll have to find an alternative way to pause on a
different thread.

Bob wrote:
I believe that I've isolated the problem to showModalDialog. Is this a
known problem with ie7? Is there an alternative to showModalDialog?
Thanks.
Bob wrote:
Thanks for your reply. Th IEVERSION variable is set in another area.
It does seem to work ok. The problem I'm having with the code is that
it infinitely executes. By that I mean, it is being called repeatedly
(like a sleep function) to allow form field processing to be handled.
Problem only on ie7.

web.dev wrote:
Bob wrote:
Hello,

The following function is failing in ie7. Can anyone offer a solution?
>
You have not given a context in which you are trying to achieve with
the code given.
>
function pause(numberMillis) {
if (IEVERSION >= 5.5) {
>
How are you obtaining the version number? Is it even reliable?
>
var dialogScript = 'window.setTimeout(function () {
window.close(); }, ' + numberMillis + ');';
var result =
window.showModalDialog('javascript:document.writel n("<script>'+dialogScript+'</script>")');
>
Generally good practice to place a type attribute:
>
<script type = "text/javascript">
>
The string '</script>' is causing the browser to think that this is
where the script actually ends. Escape the slash:
>
<\/script>
Dec 28 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.