Js can create a frame dynamically?

59 2
<frameset rows="30,*" id="frame_body_content">
<frame name="tab" id="frame_tabs" scrolling="no" id="frame_tabs">
<frame name="tab_0" class="tab" id="tab_0"> 

If you want to add a <frame> between <frameset> </frameset>, js can do it.

1 Answers

64 5

Try to try jquery 's append method to insert, and it seems impossible, but the traditional method is tested on ie.
After jquery1. 7, you might want to take the rows property with the prop.

<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.2.min.js"></script>
<script type="text/javascript">
var j = jQuery.noConflict();
 var rows = j("#frame_body_content").attr("rows");
 j("#frame_body_content").attr("rows", rows +",200");
 var frame = document.createElement("frame");
 frame.src ="http://www.vogo.cc";
<frameset rows="100,*" id="frame_body_content">
 <frame src="1.html"/>
 <frame src="2.html"/>