请问错在那里?

beauty_beast 2002-12-30 12:41:33
<!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>

为什麽显示不了字
...全文
31 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
利而不害 2002-12-30
  • 打赏
  • 举报
回复
</ v:TextBox>和</ v:Rect>
把里面的空格去掉
</v:TextBox>和</v:Rect>
孟子E章 2002-12-30
  • 打赏
  • 举报
回复
<!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>
beauty_beast 2002-12-30
  • 打赏
  • 举报
回复
谢谢帮助!
孟子E章 2002-12-30
  • 打赏
  • 举报
回复
insertBefore Method

Inserts an element into the document hierarchy as a child node of a parent object.

Syntax

oElement = object.insertBefore(oNewNode [, oChildNode])
Parameters

oNewNode 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 Value

Returns a reference to the element that is inserted into the document.

Remarks

Do 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>
孟子E章 2002-12-30
  • 打赏
  • 举报
回复
<!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);
newrect.innerText="test"
group1.insertBefore(newrect);
newtext.innerText="Good"
newrect.insertBefore(newtext);
}
test()
</script>


</BODY>
</HTML>
beauty_beast 2002-12-30
  • 打赏
  • 举报
回复
那为什麽这样写就错了!
<!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的用法?以及错在那里

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧