问题
How to pass GET parameters to jsFiddle? I tried http://jsfiddle.net/mKwcF/?id=123 but all I get is http://fiddle.jshell.net/mKwcF/show/
My example js is simple on a given link above:
alert(window.location.href);
回答1:
As of October 2014 it is a little more complicated than it used to be:
If your jsfiddle url is:
http://jsfiddle.net/u7G7n/44
use instead (including some url parameters):
http://fiddle.jshell.net/u7G7n/44/show/light/?lat1=52&lng1=9&lat2=50&lng2=1
AND send the same url (including parameters) as referer. You can use Referer Control as Chrome plugin: https://chrome.google.com/webstore/detail/referer-control/hnkcfpcejkafcihlgbojoidoihckciin
And configure like this:

Now the second link (including parameters) should work.
EDIT: Plugin RefControl works well for Firefox: http://www.stardrifter.org/refcontrol/ Configure with "fiddle.jshell.net" as site, then choose "Forge" (substitute with root address).
回答2:
Actually, the solution is pretty simple and does not involve any Chrome Plugin.
Just access top.location.search when using the domain name fiddle.jshell.net :
Working example : http://fiddle.jshell.net/techp9/hfpx9zh5/1/show/light/?test=1
回答3:
All you need is to add show at the end of the URL and then add query
e.g:
if your URL is
`http://jsfiddle.net/ishaiborovoy/Yx9P899/123/`
then You should reffer to:
`http://jsfiddle.net/ishaiborovoy/Yx9P6/123/show?myFirstParam=1&mySecondParam=2.`
This works for me.
回答4:
I was just trying to figure out the same thing and ran across this in the jsFiddle documentation.
"Note If you want to use a dynamic resource please add a dummy GET variable i.e. http://example.com/dynamically.php?somevar=somevalue&dummy=.css. This will trick jsFiddle to recognize it as CSS resource."
来源:https://stackoverflow.com/questions/16527958/how-to-pass-get-parameters-to-jsfiddle