debugging javascript paste

Discussion in 'HTML' started by Paul Furman, Feb 5, 2007.

  1. Paul Furman

    Paul Furman Guest

    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
    Paul Furman, Feb 5, 2007
    #1
    1. Advertising

  2. Paul Furman

    J.O. Aho Guest

    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.


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

    --

    //Aho
    J.O. Aho, Feb 5, 2007
    #2
    1. Advertising

  3. Paul Furman

    Andy Dingley Guest

    On 5 Feb, 06:02, Paul Furman <> wrote:
    > Is there a simple way to test whether an onclick event is working like
    > make it beep or something to test.


    alert ("Hello world!");
    Andy Dingley, Feb 5, 2007
    #3
  4. Paul Furman

    Paul Furman Guest

    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="">
    Paul Furman, Feb 5, 2007
    #4
  5. Paul Furman

    Paul Furman Guest

    J.O. Aho wrote:

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

    >
    >
    > <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!
    Paul Furman, Feb 5, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Johann Blake
    Replies:
    1
    Views:
    1,193
    Hermit Dave
    Jan 5, 2004
  2. =?Utf-8?B?Y2luZHk=?=
    Replies:
    3
    Views:
    6,042
    Bruce Barker
    Sep 16, 2005
  3. jacob navia

    Debugging C vs debugging C++

    jacob navia, Oct 26, 2006, in forum: C Programming
    Replies:
    11
    Views:
    585
    Ian Collins
    Oct 27, 2006
  4. Bani
    Replies:
    7
    Views:
    243
    Thomas 'PointedEars' Lahn
    Apr 3, 2005
  5. Mahsha
    Replies:
    2
    Views:
    2,098
    Gregor Kofler
    Jun 4, 2009
Loading...

Share This Page