New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

How do I debug javascript in Safari?


Post Reply New Thread Subscribe

 
Thread Tools
Srikanth.S
Guest
 
Posts: n/a

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
QUOTE Thanks
Murlyn

 
Murlyn's Avatar
 
Member Since: Jun 11, 2003
Location: Mount Vernon, WA
Posts: 4,909
Murlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to all
Mac Specs: MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2

Murlyn is offline
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.
QUOTE Thanks
Srikanth.S
Guest
 
Posts: n/a

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...
QUOTE Thanks
Murlyn

 
Murlyn's Avatar
 
Member Since: Jun 11, 2003
Location: Mount Vernon, WA
Posts: 4,909
Murlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to all
Mac Specs: MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2

Murlyn is offline
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.
QUOTE Thanks

Post Reply New Thread Subscribe


« Free hosts? | Image changing like on ebay? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Safari is the browser to use on OS X!! Computer.Geek OS X - Apps and Games 14 04-29-2005 03:01 PM
Javascript and Safari (earlier versions) noodles Web Design and Hosting 0 02-17-2005 02:46 PM
Javascript and Frames problem in Safari HarrySpier Web Design and Hosting 3 11-09-2004 04:47 PM
Messanger And Safari mysteriousal Apple Desktops 0 04-29-2004 08:39 AM
Safari Javascript problem babszem Web Design and Hosting 0 02-26-2004 03:21 PM

All times are GMT -4. The time now is 06:58 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?