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

beginner question

when I just have the alert on onload it works but I can't get it to
work when I've also got an alert on unLoad. What am I doing wrong??

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">

<head>
<script type="text/javascript">
function surveyQ(){alert("Please take our Customer Service Survey.");}
return true;

function thanks(){alert("We appreciate you opinions!"); } return true;

</head>
<body>
onload="surveyQ()";

onUnload="thanks()";

</body>

</script>
</html>
Mar 2 '08 #1
4 1158
beenben wrote on 02 mrt 2008 in comp.lang.javascript:
when I just have the alert on onload it works but I can't get it to
work when I've also got an alert on unLoad. What am I doing wrong??
[please leave al the crap out that has nothing to do with your Q]
function surveyQ(){alert("Please take our Customer Service Survey.");}
return true;
function thanks(){alert("We appreciate you opinions!"); } return true;
Thanks to your bad visual formatting you do not see your mistakes.

I will reformat:

function surveyQ() {
alert("Please take our Customer Service Survey.");
};
return true;

function thanks() {
alert("We appreciate you opinions!");
};
return true;

Looking for the error text and error line number can help you
if you do not see the bugs yet.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 2 '08 #2
beenben wrote:
when I just have the alert on onload it works but I can't get it to
work when I've also got an alert on unLoad. What am I doing wrong??
Maybe using `onUnload' instead of `onunload'. XHTML is case-sensitive.
[...]
<body>
onload="surveyQ()";

onUnload="thanks()";
Maybe using `onUnload' instead of `onunload'. XHTML is fully case-sensitive.

See also:

http://www.w3.org/TR/xhtml1/
http://hsivonen.iki.fi/xhtml-the-point/
http://hixie.ch/advocacy/xhtml
http://www.spartanicus.utvinternet.ie/no-xhtml.htm
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Mar 2 '08 #3
Evertjan. wrote:
[please leave al the crap out that has nothing to do with your Q]
Actually, the "crap" had everything to do with his question. For
instance, he left some attributes outside of the <bodytag, which we
would not have known if he posted only the Javascript.
Thanks to your bad visual formatting you do not see your mistakes.
I was able to read it perfectly well.
I will reformat:
It still doesn't work ;) He asked a perfectly reasonable question. If
you're going to mock him, at least do it right :D
Mar 2 '08 #4
Mango wrote on 02 mrt 2008 in comp.lang.javascript:
Evertjan. wrote:
>[please leave al the crap out that has nothing to do with your Q]

Actually, the "crap" had everything to do with his question. For
instance, he left some attributes outside of the <bodytag, which we
would not have known if he posted only the Javascript.
No, that part was not the crap.
>Thanks to your bad visual formatting you do not see your mistakes.

I was able to read it perfectly well.
>I will reformat:

It still doesn't work ;) He asked a perfectly reasonable question. If
you're going to mock him, at least do it right :D
Beside the point,because:
Reformatting shows the error, reformatting is not correcting.
I am not mocking him, though I am tempted to mock you.

I am showing him a way to find the error himself by just looking at the
code, you obviously did not see it.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 2 '08 #5

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

Similar topics

11
by: Svens | last post by:
Hey everyone! I'm a math student working on a short script involving logs. I have a function on my scientific calculator, and was wondering if there was a similar funtion in python. For example:...
3
by: jvax | last post by:
Hi all, I hope I'm posting in the right NG... I have a data text file I want to read from a c++ program. the data file goes like this: 90 # number of balls 33 42 13
1
by: Mike Malter | last post by:
I am just starting to work with reflection and I want to create a log that saves relevant information if a method call fails so I can call that method again later using reflection. I am...
14
by: z_learning_tester | last post by:
But I can't seem to find the answer. The question is how do you reverse the words in a string? Or how do you reverse the numbers listed in a string? The example is usually something like: Turn...
12
by: Blaze | last post by:
I am doing the first walk through on the Visual Studio .Net walkthrough book to learn a little about programming. I am having issues with the first tutorial not running correctly. It seems that...
5
by: optimistx | last post by:
As a beginner in javascript I had a question. I was reading FAQ and posts here. I became very unhappy: Obviously this group is mainly for wise, pedantic, unkind etc people, who already know...
10
by: Roman Zeilinger | last post by:
Hi I have a beginner question concerning fscanf. First I had a text file which just contained some hex numbers: 0C100012 0C100012 ....
4
by: a | last post by:
Dear all vb.net developer I want to know the time I need to master vb.net? I'm beginner
3
by: Ben Keshet | last post by:
I have a probably simple beginner's question - I have a script that I am currently able to print its output. instead, i want to write it into a file - I tried different versions of write() but...
2
by: roanhn | last post by:
Hello. I've to to write a master's thesis. Currently I deal with php, mysql, ajax. Fate decreed that I've to choose one of this subjects: 1.gdi+ library in .net technology 2.ado.net technology...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.