Reputation: 144
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. http://xmages.net/storage/10/1/0/d/c/upload/691ce801.png
Thanks for helping.
Upvotes: 0
Views: 369
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
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