Viacheslav Chumushuk
Viacheslav Chumushuk

Reputation: 144

Javascript debugging in Safari web browser

I have a JavaScript error in my web project, and this error appears only in Safari 5 web browser. And the problem is Safari says just error message, but not file and line where this error appears. So, I can't find which code cause this error. Does anybody know how can I find code line causes this error?

Here is shot with debugger. Debugger screenshot http://xmages.net/storage/10/1/0/d/c/upload/691ce801.png

Thanks for helping.

Upvotes: 0

Views: 369

Answers (2)

Viacheslav Chumushuk
Viacheslav Chumushuk

Reputation: 144

thanks for helping!

Problem resolved now. It was jQuery template plugin. It causes this error when some DOM element in template has ID same as template variable name. E. G.

var template = "<div id="foo">${foo}</div>"
var data = {foo: "bar"}
$.tmpl(template, data)

Solution: Rename ID of template variable name.

var template = "<div id="foo">${bar}</div>"
var data = {bar: "bar"}
$.tmpl(template, data)

Upvotes: 0

hugomg
hugomg

Reputation: 69924

Click on the "stop sign" icon until it turns blue and then rerun the code. This should make the debugger halt on the line that generated the exception (and allow you to inspect the local variables and execution stack at that point).

Upvotes: 2

Related Questions