<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html xmlns:v = "urn:schemas-microsoft-com:vml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE>
v\:* { Behavior: url(#default#VML) }
</STYLE><META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY>
<div id=testdiv>
<v:group id="group1" style="WIDTH: 500px; POSITION: relative; HEIGHT: 300px" coordsize = "5000,3000">
<v:Rect style="Z-INDEX:6;top:2000px; left:2500px;width:2000px;height:2000px" >
<v:TextBox inset="50px,50px,50px,50px" style="font-size: 100px;Z-INDEX:8">aafdasdfasdf </v:TextBox>
</v:Rect>
</v:group>
</div>
</BODY>
</HTML> </ v:TextBox>
-->
</v:TextBox>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE>
v\:* { Behavior: url(#default#VML) }
</STYLE><META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY>
<div id=testdiv>
<v:group id="group1" style="WIDTH: 500px; POSITION: relative; HEIGHT: 300px" coordsize = "5000,3000">
<v:Rect style="Z-INDEX:6;top:2000px; left:2500px;width:2000px;height:2000px" >
<v:TextBox inset="50px,50px,50px,50px" style="font-size: 100px;Z-INDEX:8">aafdasdfasdf </v:TextBox>
</v:Rect>
</v:group>
</div>
</BODY>
</HTML> </ v:TextBox>
-->
</v:TextBox>
解决方案 »
- parentNode在IE中怎么为空?
- 求易飞6.0注册机
- jQuery插入问题
- SetTimeOut为什么不起效果
- <script language="JavaScript">和 <script type = "text/javascript">有什么区别?
- 新手请教---如何访问对象子节点中的所有的某种元素节点
- 刚学习Ext4.0,感觉写的也没有差错,为何在浏览器中不显示任何东西呢?求大牛指点迷津...
- 如何用js进行对类的封装
- 函数调用函数
- 如何控制整个页面上全部控件的有效性?
- 在网页中插入RealPlayer ActiveX对象,如何实现全屏播放rm呢?
- 文字滚动可以用MARQUEE来做,但是我想让文字在页面启动的时候,文字就出现,然后滚动,并且开头的一行文字和末尾的文字循环起来
把里面的空格去掉
</v:TextBox>和</v:Rect>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html xmlns:v = "urn:schemas-microsoft-com:vml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE>
v\:* { Behavior: url(#default#VML) }
</STYLE><META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY>
<div id=testdiv>
<v:group id="group1" style="WIDTH: 500px; POSITION: relative; HEIGHT: 300px" coordsize = "5000,3000"></v:group>
</div><script language=javascript>
function test()
{
strrect="<v:Rect style=\"Z-INDEX:6;top:2000px; left:2500px;width:2000px;height:2000px\" ></v:Rect>"
strtextbox="<v:TextBox inset=\"50px,50px,50px,50px\" style=\"font-size: 100px;Z-INDEX:8\">aafdasdfasdf </v:TextBox>"
var newrect=document.createElement(strrect);
var newtext=document.createElement(strtextbox);
group1.insertBefore(newrect);
newrect.insertBefore(newtext);
}
test()
</script>
</BODY>
</HTML>
请问insertBefore的用法?以及错在那里
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE>
v\:* { Behavior: url(#default#VML) }
</STYLE><META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY>
<div id=testdiv>
<v:group id="group1" style="WIDTH: 500px; POSITION: relative; HEIGHT: 300px" coordsize = "5000,3000"></v:group>
</div><script language=javascript>
function test()
{
strrect="<v:Rect style=\"Z-INDEX:6;top:2000px; left:2500px;width:2000px;height:2000px\" ></v:Rect>"
strtextbox="<v:TextBox inset=\"50px,50px,50px,50px\" style=\"font-size: 100px;Z-INDEX:8\">aafdasdfasdf </v:TextBox>"
var newrect=document.createElement(strrect);
var newtext=document.createElement(strtextbox);
newrect.innerText="test"
group1.insertBefore(newrect);
newtext.innerText="Good"
newrect.insertBefore(newtext);
}
test()
</script>
</BODY>
</HTML>
ParametersoNewNode Required. Object that specifies the new element to be inserted into the document hierarchy. Elements can be created with the createElement method.
oChildNode Optional. Object that specifies the placement of the new element. If this parameter is specified, the new element will be inserted immediately before this existing child element. Return ValueReturns a reference to the element that is inserted into the document.ResDo not specify the oChildNode parameter when inserting the first child node. If children already exist and you do not specify the oChildNode parameter, the oNewNode becomes the last child of the parent object.This method is accessible at run time. If elements are removed at run time, before the closing tag has been parsed, areas of the document might not render.例子:
<SCRIPT>
function insertElement()
{
var nod=document.createElement("LI");
oUL1.insertBefore(nod, oLIYellow);
nod.innerText="Orange";
}
</SCRIPT>
</HEAD>
<BODY>
<SPAN onclick=insertElement()>Click <B>HERE</B> to add an item to the following list.</SPAN>
<UL id="oUL1">
<LI id="oLIRed">Red</LI>
<LI id="oLIYellow">Yellow</LI>
<LI id="oLIBlue">Blue</LI>
</UL>
</BODY>