如何带参数调用javascript?

huangrm 2002-05-01 07:42:15
谁碰到过传参数调用javacript?哥们们,给个实例。
...全文
184 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
huojiehai 2002-05-01
  • 打赏
  • 举报
回复
<html>
<body>
<form name = 'huo'>
<input type=text onblur="kk(this)" value='jdfkdfd'>
</from>
</body>
</html>
<script language = javascript>
function kk(aa)
{
alert(aa.text)
}
</script>
Lostinet 2002-05-01
  • 打赏
  • 举报
回复
。。。。
你的HTC中没有定义singlespaced,wordcount
顶多只能叫字符串传递。。
huangrm 2002-05-01
  • 打赏
  • 举报
回复
谢谢,可我<soo: 这家伙做什么,我还是不明白。您是说后面跟的field="soeditor" form="documentation" id="soEditor" height="250px" width="100%" singlespaced="false" wordcount="true" 是属性传递。那通常我们怎么使用呢? 这里用xml指定什么前缀的东东,然后引用,是这样吗?
karma 2002-05-01
  • 打赏
  • 举报
回复
这只不过是个与HTC对应的tag,其中的属性(attributes)是传到HTC内部的properties去的,这个tag的显示是由HTC中的innerHTML决定的
huangrm 2002-05-01
  • 打赏
  • 举报
回复
噢,那请您你看看

<soo:editor field="soeditor" form="documentation" id="soEditor" height="250px" width="100%" singlespaced="false" wordcount="true" />
到底做什么用呀?
huangrm 2002-05-01
  • 打赏
  • 举报
回复
其实呀,上面的soeditor.htc包含了若干的 javascript。如:

<public:property name="DocumentHTML" put="setHTML" />
<public:attach event="oncontentready" onevent="init()"/>

<script language= "JScript">



function setHTML(sVal) {

soEditor.editor.DocumentHTML = sVal+"文本变量测试1";

}



// Initialize the editor by adding the DHTML Edit Component and Table object to the document and loading the control arrays

function init(){



var tempHTML = 略
soEditor.innerHTML = tempHTML+"变量测试2";

soEditor.editor = window.document.all.soeditorbox;
soEditor.form = eval("window.document." + soEditor.form);


// load the html to be edited
//var elHidden = eval("this.form." + soEditor.Field);
soEditor.DocumentHTML = this.form.soeditor.value;

}
</script>
karma 2002-05-01
  • 打赏
  • 举报
回复
this is a tag, not javascript
huangrm 2002-05-01
  • 打赏
  • 举报
回复
就如同:

<?xml:namespace prefix="soo" ?>

<style>
soo\:editor {behavior: url(soeditor.htc);}
</style>


</HEAD>
<BODY>

<form name="documentation" action="hello.asp" method="post">

<textarea name="soeditor" style="display: none;" value="中国">中国+hello+中国</textarea>
<soo:editor field="soeditor" form="documentation" id="soEditor" height="250px" width="100%" singlespaced="false" wordcount="true" />

</form>

<soo:editor 。。。。。一样结果
huangrm 2002-05-01
  • 打赏
  • 举报
回复
噢,忘了,传递的参数有多个。
karma 2002-05-01
  • 打赏
  • 举报
回复
传参数调用javacript?? 举个例子

是这样么?
<script language="javascript" src="js.asp?id=www"></script>

js.asp is an ASP file which outputs javascript content, like

var id = "<%=Request.QueryString("id")%>";
document.write(id);

87,996

社区成员

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

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