Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <iframe name='iframe1' id="iframe1" src="empty.htm" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
- <link type="text/css" rel="Stylesheet" href="Style/simple.css" />
- var cssLink = document.createElement("link")
- cssLink.href = "style.css";
- cssLink .rel = "stylesheet";
- cssLink .type = "text/css";
- frames['frame1'].document.body.appendChild(cssLink);
- var frm = frames['frame'].document;
- var otherhead = frm.getElementsByTagName("head")[0];
- var link = frm.createElement("link");
- link.setAttribute("rel", "stylesheet");
- link.setAttribute("type", "text/css");
- link.setAttribute("href", "style.css");
- otherhead.appendChild(link);
- var cssLink = document.createElement("link")
- cssLink.href = "pFstylesEditor.css";
- cssLink .rel = "stylesheet";
- cssLink .type = "text/css";
- //Instead of this
- //frames['frame1'].document.body.appendChild(cssLink);
- //Do this
- var doc=document.getElementById("edit").contentWindow.document
- ///If you are doing any dynamic writing do that first
- doc.open;
- doc.write(myData);
- doc.close();
- //Then append child
- doc.body.appendChild(cssLink);
- var iframe = top.frames[name].document;
- var css = '' +
- '<style type="text/css">' +
- 'body{margin:0;padding:0;background:transparent}' +
- '</style>';
- iframe.open();
- iframe.write(css);
- iframe.close();
- <html>
- <header>
- <script src="/js/jquery.js" type="text/javascript">
- </header>
- <body>
- <div id='include-from-outside'></div>
- <script type='text/javascript'>
- $('#include-from-outside').load('http://example.com/included.html');
- </script>
- </body>
- </html>
- doc.open();
- doc.write('<!DOCTYPE html><html><head><meta charset="utf-8"/><meta http-quiv="Content-Type" content="text/html; charset=utf-8"/><title>Print Frame</title><link rel="stylesheet" type="text/css" href="/css/print.css"/></head><body><table id="' + gridId + 'Printable' + '" class="print" >' + out + '</table></body></html>');
- doc.close();
Add Comment
Please, Sign In to add comment