I'm writing a firefox plugin which adds a div to the top of the page with various things in it. I can change the content of the div when writing html code directly into the .innerHTML property.... but it looks very messy and it's hard to make changes to the code. I've read about iframes but it doesn't seem to work, nothing is shown but a vertical line. The object tag isn't working either. Can someone help me?
My code:
var div = document.createElement('div');
div.id='mainplugindiv';
div.style.width = '100%';
div.style.height = '150px';
div.style.background = '#313192';
div.style.color = 'white';
div.innerHTML = "<iframe src=\"test.html\"></iframe>"; //not working
var iframe = document.createElement('iframe'); iframe.src = 'url';Make sure to check in the console if the URL you require is found. (no 404 errors)