debugging javascript paste

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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.


Re: debugging javascript paste

Paul Furman wrote:
Quoted text here. Click to load it

<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".



Re: debugging javascript paste

J.O. Aho wrote:

Quoted text here. Click to load it

Solved, thanks, that debugger is handy!

Re: debugging javascript paste

Quoted text here. Click to load it

alert ("Hello world!");

Re: debugging javascript paste

Paul Furman wrote:

Quoted text here. Click to load it

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:

//Thumbnail image viewer- Dynamic Drive (

//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"
       width="640" height="428"
       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="">

Site Timeline