Results 1 to 5 of 5

Thread: No Error No Process No Function

  1. #1
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default No Error No Process No Function

    I have multiple things happening on a page and they all were working but now nothing happens for one of them and I'm not sure why. Firebug, safari inspector/ chrome inspector are bringing up no error messages which leaves me with nothing to go on. The problem is here, or earlier on (I notice it here):

    <h1><a href="javascript:saveAuthor();" onclick="ajax(request = 3); return false;">Save Author</a><a href="javascript:cancelAuthor();" onclick="cancel_form(); return false;">Cancel</a></h1>


    The cancel functions but the onclick doesn't trigger I tried an alert to confirm this part. This button does work when a different function reveals it ( there are two options to get this to show).

    Are there any other JS debugging options I can try or a way to turn on error reporting?
    Corrections to my coding/thoughts welcome.

  2. #2
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    Is there a page you can link to with this script active?

  3. #3
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    I'll try and make a static version of it. The current version is on a live db and results must be entered to see the action.
    Corrections to my coding/thoughts welcome.

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I'm not sure if this helps, but your second function (including "return false") will block the first:
    <a href="javascript:cancelAuthor();" onclick="cancel_form(); return false;">

    Remove 'return false' from the second one and you will be able to do both. Or you could add both functions to the onclick followed by 'return false', and leave the href as # or another null value.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That actually is a "null" value. Using # though isn't null, it's the page itself. Once you return false onclick you can use anything you want for the href, it will never fire. Using a javascript: thing there makes it so it won't fire even if javascript is disabled. And with or without javascript, most users will see the href in the status bar. Even though it's not what's getting fired, it gives them a clue as to what will happen when those links are clicked.

    Anyways, the code looks fine. Since there's no error, then either:

    Code:
    ajax(request = 3)
    or:

    Code:
    cancel_form()
    or both are not getting fired. Or if they are, conditions within them tell them to do nothing at the time they are fired.

    There could be several reasons, we would need to see a live version that demonstrates the problem(s) in order to be more specific.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •