You are here: Re: debugging javascript paste « HTML « IT news, forums, messages
Re: debugging javascript paste

Posted by Paul Furman on 02/05/07 21:10

Paul Furman wrote:

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация