debugging javascript paste

P

Paul Furman

Is there a simple way to test whether an onclick event is working like
make it beep or something to test. I have no clue about javascript only
php and need some help debugging.

thx
 
J

J.O. Aho

Paul said:
Is there a simple way to test whether an onclick event is working like
make it beep or something to test. I have no clue about javascript only
php and need some help debugging.

<noscript>If you see this, onclick won't work</noscript>

If you want help debugging javascript, you have a good tool in the mozilla
browsers, which gives you error messages and warnings. Look under tools meny
for the submenu "Web Development".
 
P

Paul Furman

Paul said:
Is there a simple way to test whether an onclick event is working like
make it beep or something to test. I have no clue about javascript only
php and need some help debugging.

Thanks for both replies, I'm working with the mozilla debugger now. I
had since tried in IE & had trouble sending this message to the group
last nigh so I'll send now & keep plugging away at it.

--

Alright so if I look at it in IE I see an error appear when clicking
referring to the line with the first javascript function definition.

Error: Object required


that's the bottom line below:

<head>
<script>
//Thumbnail image viewer- © Dynamic Drive (www.dynamicdrive.com)

//sample useage:
//<IMG src="myimage.jpg"
// onclick="return enlarge('images/myimage.jpg' ,event)"
// border="0" alt="">

var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all

function enlarge(which,e){ <-this line gives the error

<snip remaining code>

--

Now, unless it's necessary to have the onclick event in front of title,
I checked my syntax and it's identical to the working example I've got
and the url it passes as a value is a valid image url. I tried it with a
relative url and an absolute url and copied out of the view-source it
pastes into the address bar & produces an image. It looks like this as a
relative url:

<img src="03_PBF9672.jpg"
title="03_PBF9672.jpg"
width="640" height="428"
border="0"
onclick="return enlarge('crop/03_PBF9672.jpg' ,event)">

compare to:

//sample useage:
//<IMG src="myimage.jpg"
// onclick="return enlarge('images/myimage.jpg' ,event)"
// border="0" alt="">
 
P

Paul Furman

J.O. Aho said:
<noscript>If you see this, onclick won't work</noscript>

If you want help debugging javascript, you have a good tool in the
mozilla browsers, which gives you error messages and warnings. Look
under tools meny for the submenu "Web Development".

Solved, thanks, that debugger is handy!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top