Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <object name="nestedPage" data="http://abc.com/page.html" type="text/html"
- width="500" height="400" />
- d = document.getElementsByTagName('object').namedItem('nestedPage').getContentDocument();
- d.styleSheets[d.styleSheets.length].href = 'whereever';
- $("link [rel=stylesheet]", myFrame).attr('href', <new-url>);
- function applyCSS(css) {
- // http://www.quirksmode.org/bugreports/archives/2006/01/IE_wont_allow_documentcreateElementstyle.html
- if (BrowserDetect.browser=="Safari" || BrowserDetect.browser=="Opera") { /* good for FF too */
- var styleNode = document.createElement("style");
- styleNode.setAttribute("type", "text/css");
- styleNode.appendChild(document.createTextNode(css));
- head.appendChild(styleNode);
- } else {
- var div = document.createElement("div");
- div.innerHTML = "<p>x</p><style>"+css+"</style>";
- document.body.appendChild(div.childNodes[1]);
- }
- }
- var doc = iframe.document;
- if(iframe.contentDocument)
- doc = iframe.contentDocument; // For NS6
- else if(iframe.contentWindow)
- doc = iframe.contentWindow.document; // For IE5.5 and IE6
- // Put the content in the iframe
- doc.open();
- doc.writeln(content);
- doc.close();
Add Comment
Please, Sign In to add comment