473,383 Members | 1,829 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,383 software developers and data experts.

In some case "<body onload=alert" don't work in IE6

I have an asp page with this tag

<body onLoad="show_msg('<%=error_msg%>');">

where "show_msg" is a javascript function that shows the message
contained in the asp variable "error_msg" only if this variable is not
empty. The message is shown using the "alert()" function.

The page works good in almost all the case, but some users have reported
to my that the alert window don't appear.

Evidently the problem is due to theirs configuration of IE (the most of
users don't have this problem), so I've contacted one of these users to
configure his IE step to step.

I've disabled the "Block popup" function and I've configured IE
following a working IE configuration on another computer.
In detail I've imposted the configurations related with the "Security"
and "Advanced" tab.
For the first I've imposted the Internet zone security to "custom" and
reproduced the configuration of the working computer.
I've done the same for the "Advanced" tab.

In spite of this operations IE continues to doesn't show the alert window.

So, finally, the question is: there is some other element of IE beyond
the three I've signaled that can produce this problem?

Thanks
Tonio Tanzi
Jul 28 '07 #1
9 5282
On Jul 28, 4:22 am, Tonio Tanzi <t.ta...@alice.itwrote:
I have an asp page with this tag

<body onLoad="show_msg('<%=error_msg%>');">

where "show_msg" is a javascript function that shows the message
contained in the asp variable "error_msg" only if this variable is not
empty. The message is shown using the "alert()" function.

The page works good in almost all the case, but some users have reported
to my that the alert window don't appear.
Perhaps the error message has an apostrophe in it. Are they getting a
script error?
>
Evidently the problem is due to theirs configuration of IE (the most of
users don't have this problem), so I've contacted one of these
Scripting disabled?

users to
configure his IE step to step.
>
I've disabled the "Block popup" function and I've configured IE
Has nothing to do with it.

Jul 28 '07 #2
Tonio Tanzi said the following on 7/28/2007 4:22 AM:
I have an asp page with this tag

<body onLoad="show_msg('<%=error_msg%>');">

where "show_msg" is a javascript function that shows the message
contained in the asp variable "error_msg" only if this variable is not
empty. The message is shown using the "alert()" function.

The page works good in almost all the case, but some users have reported
to my that the alert window don't appear.

Evidently the problem is due to theirs configuration of IE (the most of
users don't have this problem), so I've contacted one of these users to
configure his IE step to step.

I've disabled the "Block popup" function and I've configured IE
following a working IE configuration on another computer.
In detail I've imposted the configurations related with the "Security"
and "Advanced" tab.
For the first I've imposted the Internet zone security to "custom" and
reproduced the configuration of the working computer.
I've done the same for the "Advanced" tab.

In spite of this operations IE continues to doesn't show the alert window.

So, finally, the question is: there is some other element of IE beyond
the three I've signaled that can produce this problem?
There have been problems in the past with IE where the onload doesn't
get triggered if the page is retrieved from the cache. The simplest way
to test and see if that is what is happening here is to add a dummy
parameter to the URL to test with. Simply add ?somethingUnique1 and load
the page and see if the alert shows up.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 28 '07 #3
David Mark ha scritto:
On Jul 28, 4:22 am, Tonio Tanzi <t.ta...@alice.itwrote:
>I have an asp page with this tag

<body onLoad="show_msg('<%=error_msg%>');">

where "show_msg" is a javascript function that shows the message
contained in the asp variable "error_msg" only if this variable is not
empty. The message is shown using the "alert()" function.

The page works good in almost all the case, but some users have reported
to my that the alert window don't appear.

Perhaps the error message has an apostrophe in it. Are they getting a
script error?
No in this message there isn't an apostrophe, however I know that when
it appear I have to escape it (\').

Tonio Tanzi
Jul 29 '07 #4
Randy Webb ha scritto:
There have been problems in the past with IE where the onload doesn't
get triggered if the page is retrieved from the cache. The simplest way
to test and see if that is what is happening here is to add a dummy
parameter to the URL to test with. Simply add ?somethingUnique1 and load
the page and see if the alert shows up.
I will do this attempt.
If this is the problem, I think it can be due to the presence of a
proxy, isn't it?

Thanks

Tonio Tanzi
Jul 29 '07 #5
Randy Webb ha scritto:
....

If the problem is due to a proxy how can I force the reloading of the page?

Thanks

Tonio Tanzi
Jul 29 '07 #6
Tonio Tanzi said the following on 7/29/2007 3:30 AM:
Randy Webb ha scritto:
...

If the problem is due to a proxy how can I force the reloading of the page?
Send the proper Headers from the server.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 30 '07 #7
Tonio Tanzi wrote:
David Mark ha scritto:
>On Jul 28, 4:22 am, Tonio Tanzi <t.ta...@alice.itwrote:
>>I have an asp page with this tag

<body onLoad="show_msg('<%=error_msg%>');">

where "show_msg" is a javascript function that shows the message
contained in the asp variable "error_msg" only if this variable is not
empty. The message is shown using the "alert()" function.

The page works good in almost all the case, but some users have reported
to my that the alert window don't appear.
^^^^^^^^^^^^
>Perhaps the error message has an apostrophe in it. Are they getting a
script error?

No in this message there isn't an apostrophe, however I know that when
it appear I have to escape it (\').
Another explanation is that the error message has a quote in it, which
would result in something like

<body onLoad="show_msg('..."..."...');">

The resulting script code would then be

show_msg('...

which is a syntax error as well.

However, since you are writing about a window, it is more likely that
the popup blocker is blocking the alert window when called from within a
load event listener. Don't do that anyway.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not the
best source of advice on designing systems that use javascript.
-- Richard Cornford, <f8*******************@news.demon.co.uk>
Aug 1 '07 #8
On Aug 1, 3:08 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
[snip]
>
However, since you are writing about a window, it is more likely that
the popup blocker is blocking the alert window when called from within a
He said he disabled the popup blocker in IE, though I suppose there
could be others running on the user's machine. And what popup blocker
blocks JavaScript alerts?
load event listener. Don't do that anyway.
I agree with that. Better to display the error message at the top of
the page.

Aug 1 '07 #9
David Mark wrote:
On Aug 1, 3:08 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
[snip]
>However, since you are writing about a window, it is more likely that
the popup blocker is blocking the alert window when called from within a

[...] And what popup blocker blocks JavaScript alerts?
IIRC Gecko's (version unknown), when they are triggered via the `load'
event. Had you not crippled the context again, you would have known.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not the
best source of advice on designing systems that use javascript.
-- Richard Cornford, <f8*******************@news.demon.co.uk>
Aug 2 '07 #10

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

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
3
by: George Hester | last post by:
Nothing. The applet does what it is supposed to do but onload never fires. Any suggestions what may be the problem here? Thanks. -- George Hester __________________________________
6
by: Jon Davis | last post by:
I recently learned how to do an <OBJECT> alternative to <IFRAME> in current browsers using: <object id="extendedhtml" type="text/html" data="otherpage.html" width="250" height="400"></object> ...
7
by: Calvin KD | last post by:
Hi everyone, Has someone out there experienced the same problem? What i wanted to do is to display a popup window (modal) upon the loading of a webpage. Here is my code sample (in html view):...
22
by: stephen | last post by:
I have created an order form that users javascript to create a new html document when the customers clicks the "print page" button. Once the new document has been created it then prints the...
3
by: Reinhold Schrecker | last post by:
Hi there, I am trying to generate a dynamic menu with JavaScript/DOM and have problems to set the onclick-attribute for my <a>-elements. The following code works fine in Opera and Mozilla but...
5
by: Jason | last post by:
Hello, I am trying to dynamically create a table, then set its <td>'s onclick: var table = document.createElement("table"); var row = table.insertRow(-1); var td = row.insertCell(-1);...
5
by: tuxedo | last post by:
The way the <body onload="something()"works ensures that the complete html document is loaded before something() is executed. Can the same be achieved when placing the onload call in document...
11
by: jesdynf | last post by:
I'm having trouble applying a stylesheet to content I'm generating after the fact. Here's the sample code: <html> <head> <title>CSS/DOM Problem Example</title> <style type="text/css">...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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.