yrstruly,
I replaced the DOCTYPE and html begin tag with this statement in order to
keep browsers from entering quirks-mode.
You original code worked fine in most of my browser tests except for IE8 RC.
<!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="en" lang="en">
You might consider using IETester to verify which versions of IE your
scripts work with, http://www.my-debugbar.com/wiki/IETester/HomePage.
Hope this helped.
Chuck Wagner
Subject: [jQuery] jQuery introduction script (Alert Message is now showing!)
Hallo
Im new to jQuery. I have donwloaded the jquery-1.3.2min file and i
have copied that introduction code from the website and saved it in
the same directory as the jquery file. When i run the script it seems
to be working and when i click on the link it goes to the website, but
isnt this script suppose to show an alert message first, before it
goes to the website?
Please what am i doing wrong? Have a saved it correctly or is the file
i donwloaded not valid? Please help. The code follows:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("a").click(function(event){
alert("Thanks for visiting!");
});
});
</script>
</head>
<body>
<a href="http://jquery.com/">jQuery</a>
</body>
</html>