<html> <head> <frameset rows = "70, *"> <frame name = "top" src = "frame.html"> <frameset cols = "150, *"> <frame name = "left" src = "frame.html"> <frame name = "main" src = "frame.html"> </ frameset> </ frameset> </ head> </ html>
<html> <head> <link rel = "stylesheet" href = "style.css"> </ head> <body> </ body> </ html>
<html> <head> <script> parent.bindMe (this) </ script> </ head> <body> </ body> </ html>
function bindMe (obj) {
AppendInlineCss (obj.document.getElementsByTagName ('head') [0], cssText)
}
<html>
<head>
<link rel = "stylesheet" href = "style1.css">
<link rel = "stylesheet" href = "style2.css">
<link rel = "stylesheet" href = "style3.css">
<script>
function AppendInlineCss (obj, css) {
obj.appendChild (function () {
var inline = document.createElement ('style')
inline.type = 'text / css'
inline.textContent = css
return inline} ())
}
function GatherCssText () {
var cssText = ''
for (var i = 0, cnt = document.styleSheets.length; i <cnt; i ++) {
var rules = document.styleSheets [i] .cssRules || document.styleSheets [i] .rules
for (var j = 0, c2 = rules.length; j <c2; j ++) {
cssText + = rules [j] .cssText
}
}
return cssText
}
var cssText = GatherCssText ()
function bindMe (obj) {
AppendInlineCss (obj.document.getElementsByTagName ('head') [0], cssText)
}
</ script>
<frameset rows = "70, *">
<frame name = "top" src = "frame.html">
<frameset cols = "150, *">
<frame name = "left" src = "frame.html">
<frame name = "main" src = "frame.html">
</ frameset>
</ frameset>
</ head>
</ html>
Source: https://habr.com/ru/post/30783/
All Articles