This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Detecting Browser Dependant JavaScript Code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Detecting Browser Dependant JavaScript Code" Watch "Detecting Browser Dependant JavaScript Code" New topic
Author

Detecting Browser Dependant JavaScript Code

Udit Manektala
Ranch Hand

Joined: Sep 17, 2006
Posts: 30
Is there a tool\ utility\website that I cna use to pass a JS file\JS Code Snippet and it detects all the browser dependant code ?

How do most programmers go about converting browser dependant JS code into browser independent code? I have a JS file i made a while back which only runs on IE and i wanna make it browser independent. Im planning on using ProtoType.JS. Is there any way to identify all the lines of code that need changing so then I can find the equivalent prototype.js fxns to replace them.
Or do I just have to go by line by line in debug mode ?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
There is no such utility...

Download http://www.getfirebug.com

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

I know of no such tool, sorry. I guess that's a hard lesson in writing browser-independent code in the first place.

I'd not recommend a line-by-line translation. If you are going to be using Prototype, it'd be best to look at how you are doing things at a higher level and start doing things using Prototype's help even where you do not detect cross-browser issues. You are liable to find your code vastly simplified.
[ April 04, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Detecting Browser Dependant JavaScript Code
 
Similar Threads
Importing javascript in a JSP
Prototype Ajax.Request error - Function Expected Options
How to assign file name to a variable
method.call(..) throws "object doesn't support this property" on some browsers
Why the title is "Object-Oriented JavaScript"