MarkKGreenway
MarkKGreenway

Reputation: 8774

Javascript testing resource

I have a development site which seems to have an intermittent Javascript error in IE7. Now I can fully test IE7, but I was wondering if there is a resource that would allow me to analyze the Javascript for possible browser issues.

Upvotes: 0

Views: 101

Answers (4)

Zachary K
Zachary K

Reputation: 3345

You may wish to try using Selenium for scenario tests as well.

Upvotes: 0

Stefan Kendall
Stefan Kendall

Reputation: 67892

Look for any code that runs as the page loads.

ex:

<script src = "test.js"></script>

test.js

document.getElementById("whatever");

Depending on the speed of the JS interpreter, you'll get a race condition with the loading of the script vs. the loading of the DOM. If the issue is "intermittent", this is almost certainly the problem. Stick everything that looks at the DOM in $(document).ready

Upvotes: 1

Larry K
Larry K

Reputation: 49114

A common IE-only problem is the inclusion of closing commas in array or object literals. Non-IE browsers handle this fine.

Are you generating any array or object literals via a JSON response or similar?

Eg

a = [1,2,4,]; // error in IE, not in other browsers
b = {a: 1, b: 2,}; // also error in IE 

Upvotes: 1

Brandon
Brandon

Reputation: 70052

You can try running your javascript through JSLint

Upvotes: 1

Related Questions