Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6914869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:24:10+00:00 2026-05-27T09:24:10+00:00

I would like to implement a simple Javascript Playground like jsFiddle and was wondering

  • 0

I would like to implement a simple Javascript Playground like jsFiddle and was wondering on the best way to achieve this. From the way jsfiddle works, it creates an iframe with the submitted HTML/Javascript code. The source of the iframe comes from a dynamically created page from the jsfiddle server.

I was wondering if it would be possible to do this with client side javascript code only. I have tried this but does not work (custom code is not executed and do not know if jquery is loaded in the iframe):

$iframe = $(document.createElement("iframe"))

$html = $iframe.contents().find("html")

//HTML code
$html.children("body").append($(htmlcode))

//Javascript code (first jquery and then custom code)
$script = $(document.createElement("script"))
$script.attr("src","jquery.js")
$html.children("head").append($script)

$script = $(document.createElement("script"))
$script.html(javascriptcode)
$html.children("head").append($script)

$iframe.appendTo($("body"));
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:24:11+00:00Added an answer on May 27, 2026 at 9:24 am

    You don’t have to be that complex.
    Just open a new window (or an iframe) and put your HTML inside it.

    Demo: http://jsfiddle.net/DerekL/uSrU6/4 (UPDATED)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is some simple JavaScript code I would like to implement, butit does not
I would like to implement a simple plugin system for my script. I'll be
I am trying to learn Java. I would like to implement a simple networked
I would like to implement the following simple pattern in an android app: Activity
i would like to implement a thread framework using simple c and timers....can anyone
I'd like to implement a simple class (in Java) that would allow me to
I would like to implement a command line interface for a Java application. This
I would like to implement a simple (testing purposes only) in memory repository as
I would like to implement something similar to a c# delegate method in PHP.
I would like to implement a data access object pattern in C++, but preferably

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.