Results 1 to 4 of 4
  1. #1
    Srikanth.S
    Guest
    How do I debug javascript in Safari?
    Hi All,
    This is my first post to this forum.I'm using Mac-Tiger 10.4.1 version and safari version 2.0 .My Questions are as follows,
    1.How do I debug javascript code using safari browser.B'cos I can't able to find any javascript errors thru safari browser.
    2.The following code is not executed well in Safari Browser.
    Code:
    document.write("<script type='text/javascript'>");
      document.write("some code here");
      document.write("document.forms[i].submit()");
      document.write("</script>");
    I'm getting alert as the form has been submitted but i didn't get the desired output from the script.
    Whether this type of form submission is correct or not? Waiting for ur kind replies.

    Thanks in Advance,
    Srikanth.S

  2. #2
    How do I debug javascript in Safari?
    Murlyn's Avatar
    Member Since
    Jun 11, 2003
    Location
    Mount Vernon, WA
    Posts
    4,915
    Specs:
    MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
    Try shift-command(apple)-J that should open up the javascript console. If it does not, you need to turn on the debugging menu. You can do that by closing safari then opening up your terminal and typing this in:

    Code:
    defaults write com.apple.Safari IncludeDebugMenu 1
    Then reopen safari and you should see a new debug menu in the menu bar.

  3. #3
    Srikanth.S
    Guest
    Murlyn,

    Thanks for the reply.

    Is there any difference in executing the follwing statement in safari browser[ Tiger & panther]

    document.write("document.forms[i].submit()");

    The above statment got executed in Panther [safari 1.X] but same statement is not executed in Tiger [safari 2.x].

    Is there any difference?
    Is there any work around to get executed?

    Any help would be appreciated...

  4. #4
    How do I debug javascript in Safari?
    Murlyn's Avatar
    Member Since
    Jun 11, 2003
    Location
    Mount Vernon, WA
    Posts
    4,915
    Specs:
    MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
    I am really not sure on this one, since Im not the best with javascript, hopefully someone else will be able to help you out on this one.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Debugging JavaScript in Safari
    By ewgoforth in forum OS X - Operating System
    Replies: 2
    Last Post: 07-31-2013, 04:13 PM
  2. Javascript problems in safari
    By pandora_dora in forum Web Design and Hosting
    Replies: 1
    Last Post: 09-27-2011, 10:59 PM
  3. Safari Javascript Help
    By bluecollar01 in forum Web Design and Hosting
    Replies: 0
    Last Post: 04-12-2011, 09:13 AM
  4. Safari and javascript problem.
    By DaveDawn in forum Web Design and Hosting
    Replies: 3
    Last Post: 06-28-2008, 12:55 PM
  5. Safari Javascript problem
    By babszem in forum Web Design and Hosting
    Replies: 0
    Last Post: 02-26-2004, 03:21 PM

Posting Permissions

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