Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


jQuery .on() not firing in real-time view. #148

phuu opened this Issue · 3 comments

2 participants

Tom Ashworth Remy Sharp
Tom Ashworth

jQuery .on() events will not fire in real time view, but will in render view.

Include jQuery 1.7 or later. Example code fails:

$(function () {
  $('body').on('click', function (e) {

-- RS edit --

Example link:

Remy Sharp

Issue with ready event firing before the iframe is done. Already handles $(document).ready - probably need to add the same hack in place.

Remy Sharp

Okay, so the live render never shows you alerts, prompts or confirm boxes - because it re-renders as you type, an alert box firing all the time would interrupt the development flow. The "render" button does include alerts because you're triggering it.

So in fact it's on purpose that the alert doesn't work - so technically a feature!

However, it does give me an idea - I could nuke all alerts loading and then re-introduce the alert method once render is complete so that if you interact with the preview, it'll still fire alerts.

I'm not 100% about this, but I'll try it out in the jsbin beta: - it'll be live in a few minutes....

Remy Sharp remy closed this
Remy Sharp

Working example of where the alerts are removed during load, but re-instantiated once all user code is complete:,javascript,live

Remy Sharp remy referenced this issue from a commit
Remy Sharp remy Remove alerts only during load - put them back in to allow user to in…
…teract and get alerts. Fixes #148
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.