大家一起来写触发事件------文字编辑器功能提升:实现单行文本框,这个触发事件该咋么写? theContent.html里面什么都没有啊用input type="text" 就只能输入一行 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 晕~~--------------------------------------要求theContent.html中只能输60个字符的长度而且屏蔽掉回车键在theMain.html中看起来要求是单行文本框的效果,OK?---------------------------------------谁能解决,谁给高分 因为INPUT = TEXT类型所输入的文字内容没法+URL地址连接,没法+文字样式所以我采取了类似文字编辑器的思路,想做个有URL地址连接,文字样式功能的"单行文本框" 在theContent.html里边放个html元素,如input,div等,不要用designMode,不然onkeypress事件不会触发 可以啊a.html<script for="document" event="onkeypress"> if(event.keyCode ==13){ event.returnValue = false alert("error"); }</script>去掉document.designMode,用这个和onkeypress冲突b.html<body onload="javascript:document.frames[0] = 'on';"><iframe src="a.html" width="100%" height="100%" frameborder=1 BORDERCOLOR="#FF9933" vspace=0 hspace=0 id="Frm_theContent" name="Frm_theContent" scrolling=no marginwidth=0 marginheight=0></iframe></body>打开b.html你按回车会触发的,显示error 楼上兄弟:b.html<body onload="javascript:document.frames[0] = 'on';">这句我测试了不起作用啊,信息输不进去,不可录入状态啊 <form name=form1><textarea name=t1 cols=50 maxlength=60 style="overflow:hidden;height:20" onkeypress="if(event.keyCode==13)event.returnValue=false;"></textarea><input type=button value='link' onclick='addlink();'><input type=button value='color' onclick='addcolor();'></form><script>function addlink(){var o=document.createElement("A");o.href="http://www.csdn.net/";o.innerText="www.csdn.net";document.form1.t1.appendChild(o);}function addcolor(){var o=document.createElement("FONT");o.color="red";o.innerText="www.csdn.net";document.form1.t1.appendChild(o);}</script> 哪位高手愿意帮忙解密下这段JS 真心看不懂啊 JQuery指定位置添加<td> 但是没有添加到想到的位置后面 新手问个基础问题 javascript的一段代码找错 JS计算两个日期之间的天数 回车行,但Esc却不行,为什么? 怎么去的数组的最后一个值 关于 target 的问题 ,分不够再送 急~~~!!! 十万火急!如何实现把文本框里的字符从右往左逐个删除? 请问javascript里面有没有类似jsp里面replaceAll的函数? 下拉菜单能不能实现同时可以直接输入?
--------------------------------------
要求
theContent.html中只能输60个字符的长度而且屏蔽掉回车键在theMain.html中看起来要求是单行文本框的效果,OK?---------------------------------------
谁能解决,谁给高分
所以我采取了类似文字编辑器的思路,想做个有URL地址连接,文字样式功能的"单行文本框"
a.html
<script for="document" event="onkeypress">
if(event.keyCode ==13){
event.returnValue = false
alert("error");
}
</script>
去掉document.designMode,用这个和onkeypress冲突
b.html
<body onload="javascript:document.frames[0] = 'on';">
<iframe src="a.html" width="100%" height="100%" frameborder=1 BORDERCOLOR="#FF9933" vspace=0 hspace=0 id="Frm_theContent" name="Frm_theContent" scrolling=no marginwidth=0 marginheight=0></iframe>
</body>
打开b.html你按回车会触发的,显示error
<body onload="javascript:document.frames[0] = 'on';">
这句我测试了不起作用啊,信息输不进去,不可录入状态啊
<textarea name=t1 cols=50 maxlength=60 style="overflow:hidden;height:20" onkeypress="if(event.keyCode==13)event.returnValue=false;"></textarea>
<input type=button value='link' onclick='addlink();'>
<input type=button value='color' onclick='addcolor();'>
</form>
<script>
function addlink(){
var o=document.createElement("A");
o.href="http://www.csdn.net/";
o.innerText="www.csdn.net";
document.form1.t1.appendChild(o);
}
function addcolor(){
var o=document.createElement("FONT");
o.color="red";
o.innerText="www.csdn.net";
document.form1.t1.appendChild(o);
}</script>