Adding an iframe by JAVASCRIPT -


i trying javascript adds iframe javascript. create iframe before tag.

you can see jsfiddle demo. dont want add tag. want add external .js file things on own!

use this

var newelem = createelement('script'); newelem.setattribute('src',      'http://example.com/js/script.js'); newelem.setattribute('type',     'text/javascript'); newelem.setattribute('language', 'javascript'); document.getelementbyid('idfromtheheadelem').appendchild(newelem); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -