PDA

View Full Version : My javascript codes won't do anything.. even when copied from a tutorial. Help?



jonathan_scream
16 Dec 2009, 05:45 AM
So I'm attempting to learn javascript using libraries and stuff, mostly along the ajax lines. Being that I'm teaching myself, I'm using tutorials. This code is something copied from a tutorial directly to my page:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Untitled document</title>
<script src="/javascripts/prototype.js" type="text/javascript"></script>
<script src="/javascripts/scriptaculous.js" type="text/javascript"></script>
</head>
<body>
<div onclick="$(this).switchOff()">Click here if you've seen enough.</div>
</body>
</html>

The javascript libraries are in my hosting folder /test/javascripts/ and this html file is in /test/ajaxtest.html

The page is http://www.screamdigitalmedia.com/test/ajaxtest.html

Any guidance would be amazing.

Learningcn
05 Jan 2010, 01:01 AM
you can try a firefox plugin named Firebug to find out what is goes wrong