JSFiddle Docs
  • JSFiddle Docs & Help
  • Getting started
  • Panels settings
  • Editor settings
  • Fiddle meta
  • External resources
  • Embedding fiddles
  • Async requests
  • Github Integration
    • Display fiddle from a Github repository
    • Display fiddle from Gist
    • Pass response directly from a Github repo
    • Pass response directly from Gist
  • API
    • Displaying user fiddles
    • Display a fiddle from POST
    • Get username
  • Use cases
    • Demos for products or libraries
    • Bug reporting (test-case) for Github Issues
    • Answers on Stack Overflow
    • Live code collaboration
    • Conducting live interviews for developer positions
    • Code snippets hosting
Powered by GitBook
On this page
  • URL Structure
  • Framework
  • Dependencies
  • POST variables
  1. API

Display a fiddle from POST

It's possible to display a fiddle that's not saved in JSFiddle, using a POST from a 3rd-party source

URL Structure

  • framework – the desired framework name. Which framework should be loaded with the fiddle.

  • version – substring of the framework version - the last passing will be used. If 1.3 will be given, JSFiddle will use the latest search result. it will favorize 1.3.2 over 1.3.1 and 1.3.

  • dependency_list – comma separated list of dependency substrings. It would mark any dependency containing the substring.

Framework

The framewrok to load (or the lack of it) has to be specified in the URL, for example: jsfiddle.net/api/post/{framework}/{version}

If you don't want to use a framework use library/pure, for example: jsfiddle.net/api/post/library/pure/

Dependencies

There is an option to add dependencies as a comma separated list: jsfiddle.net/api/post/{framework}/{version}/dependencies/{dependency_list}/

POST variables

All fields are optional. New fiddle setting will be used if no data provided.

POST https://jsfiddle.net/api/post/:framework/:version/dependencies/:dependency_list/

Request Body

Name
Type
Description

normalize_css

string

yes or no - should normalize.css be loaded

wrap

string

Set the JS code wrap: Accepts: - l for onload - d for domready - h for no wrap at bottom of HEAD - b for no wrap at bottom of BODY

html

string

code for the HTML panel

css

string

code for the CSS panel

js

string

code for the JS panel

html_panel

integer

language for the HTML panel. Accepts 0 only.

css_panel

integer

language for the CSS panel. Accepts: - 0 for CSS - 1 for SCSS

js_panel

integer

language for the JS panel Accepts: - 0 for JavaScript - 1 for CoffeeScript - 2 for JavaScript 1.7 - 3 for

title

string

Title of the fiddle

description

string

Description of the fiddle

dtd

string

Documents definition type. Accepts a substring of the chosen DTD (ie html 4).

resources

string

a comma separated list of external resources

Example:

PreviousDisplaying user fiddlesNextGet username

Last updated 5 years ago

http://jsfiddle.net/3Lwgk4c5/