Stylized line drawing of mark playing the flute

Can't load XRegExp twice in the same frame

Have you ever gotten this error when using jQuery to handle DOM events?

Can't load XRegExp twice in the same frame

In many cases, I’ve found that to be caused by code like this:

$(β€˜a.foo’).click( function() {  alert(β€˜You clicked on me!’);});

when a.foo * doesn’t exist in the DOM yet*.

The fix? Use jQuery.live() to bind to the event.

$(β€˜a.foo’).live( β€˜click’, function() {  alert(β€˜You clicked on me!’);});

I've also run into a couple of situations where Chrome Extensions for formatting JSON & XML also caused this error in some cases. Disabling those extensions also fixed the error.

Thanks to this Stackoverflow answer for the suggestion.