Javascript: Chrome is a lot more restrict

Today I ran into an issue where simple javascript would stop running for no apparent reason.

I finally traced the problem down to where I was handling the response on a jquery.form callback:

 

                            if (response.message instanceof Array) {
                                var html = "";
                                for (var line in response.message) {
                                    html += "<li>" + line + "</li>";
                                }
                            } else {
                                html = response.message;
                            }
                            $("#errorMessages ul").html(html);

 

Since I was missing "var" in the for loop for response.message, chrome would thrown an error, and no more code would run on the iframe…

Noting that it was working yesterday, that drove me nuts for a while.

 

Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • IGlr