Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass GET parameters to jsFiddle

Tags:

jsfiddle

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);
like image 732
Nikola Avatar asked May 13 '13 17:05

Nikola


People also ask

How to enter code in JSFiddle?

JSFiddle has the notion of panels (or tabs if you switch into the tabbed layout), there are 4 panels, 3 where you can enter code, and 1 to see the result. CSS - styles. You can switch pre-pocessor to SCSS

How to pass multiple parameters to a GET method?

You have multiple options for passing multiple parameters to a GET method: FromRouteAttribute, FromQuery and Model Binding. In this article, we are going to learn how to pass multiple parameters to a GET method. This article covers the following points: What are the ways to pass multiple parameters to a GET method? What is Model Binding?

How to retrieve all the GET parameters of a website?

Method 1: Using the keys specified in the address: The class URLSearchParams takes in the address of the website and searches for value associated with the key provided. Method 2: Using the forEach property of the URLSearchParams class to retrieve all the GET parameters. Writing code in comment?

How to get the respective values from each pair of URL parameters?

Our task is to get the respective values from each pair which are also known as GET parameters. Method 1: Using the keys specified in the address: The class URLSearchParams takes in the address of the website and searches for value associated with the key provided.


2 Answers

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

like image 67
myriacl Avatar answered Oct 21 '22 03:10

myriacl


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: enter image description here

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).

like image 39
Jack Miller Avatar answered Oct 21 '22 05:10

Jack Miller