Remove inline onclick handlers #417

wants to merge 1 commit into

3 participants


Using your plugin in a chrome extension, and chrome forbids inline onclick handlers:

Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:".


I've removed the two instances on onclick from select2. The first instance I swapped out to use your killEvent helper and the second one was superfluous since killEvent was being called in the handler anyway.


this was added as part of #330, any ideas?


Yeah no idea, I don't currently have an IE to test on so that kinda sucks.


From what I can tell from the link he posted, the actual solution is only dependent on the href="#" instead of href="javascript:void(0)", but I have no way to test this assertion.

Select2 member

The issue in #330 is now back in play because #487 had to reintroduce the changed line. Chosen fixed this previously by just stopping the propagation of the click, which seems like a really simple solution.



@kevin-brown yep, that was my thinking. This fix does kill the click event, so I'd be interested if it possibly solves both issues.


closing until a viable solution is found.

@ivaynberg ivaynberg closed this Feb 10, 2013
@rice rice referenced this pull request Apr 12, 2013

Remove inline styles #1180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment