How to pass jQuery to eval’d code?

First, check out my fiddle fiddle

jsFiddle is nice, but sometimes it runs a bit slow, so I made this simple pure JS fiddle (can be ran locally)

Working great so far, but I want to be able to use jQuery in my fiddle. Type alert(typeof $ ); in the bottom left box and press “Run” to see what I mean (says undefined).

So how do I pass jQuery off to the iframe and give it the correct context? I suspect I could set doc.contentWindow.$ =$ or something like that, but I still need to give the correct context so it knows where to find the elements. How would I do that?

newest questions tagged jquery – Stack Overflow

About Admin