How to Inject Custom HTML and CSS into an iFrame

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
13,521
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Nov 21, 2011

Ever been to a site like JSBin, where you can write HTML, CSS, and JavaScript, and then see the results in a panel to the right? An iframe is how we can accomplish this task.

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (nettutsplus)

  • Wonderful Jeffrey :) Thanks for the tutorial!

    I have only one question while watching the tutorial, so forgive me if it seems obvious. Why you have .children('style')? What does it do? Thanks, mate!

  • @al3xandremagalhaes Because I want to make the styleTag reference that style tag. Otherwise, it would reference the head tag of the iframe element.

  • Your voice sounds very similar to the "Angry former google employee explaining google wave". And if that IS you, you're awesome.

  • @TheJaredWilcurt Not me.

see all

All Comments (24)

Sign In or Sign Up now to post a comment!
  • If there is a head tag in the html textarea is there a way to inject what’s inside this head tag in the head tag of the iframe ? I tried to add a find to the .val but it doesn’t works.

  • @RavacSRB yes there are differences about page's load time and some errors, js sould not run before page fully loaded. insert it before closing body tag.

  • Hi Jefferey, I'd just like to say a huge thanks for all the videos you posted over the years. Especially the codeigniter tutorials, I was scared of MVC at first but after watching your vids and playing around I am now confident in codeigniter and MVC and my work has not only increased but is esier to achieve!!

    Loving this also!

  • its about time an iframe becomes depricated.

  • @Elron4u

    yes (requires work around for ie7) you would use box-sizing:content-box; (which would use the webkit / mozilla box model) as box-sizing:border-box; use the IE box model.

  • just a quick question.Im doing the 30 day html and css course and its brillant.Im not finished yet and im worried that once i finish i wont know what to work on next.advice?

  • Is the box model cross platform? If not how you fix the problem then?

  • Hi Jeff, can you tell me, is there any difference if I include js files in the "head" of a document or just above "/body" as you did in the video ?

    Cheers

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more