One thing jsFiddle lacks is the ability to import stuff from another fiddle. It’s king of frustrating not to be able to do it, moreover when it’s coupled with the inability to upload stuff.
Here is a possible solution that will work at least for your own fiddles. The idea is to somehow mark the pieces of code you want to export. Something like this:
Then, in the fiddle you want to import to, you can use my $.proxyGet jQuery plugin to download your fiddle, extract those pieces, join them again and globally eval them. Something like this:
Which will dutifully show the following message in its console:
Just imported and executed some code.
One Reply to “How to include a jsFiddle into another jsFiddle”