页面定位的问题??? focus方法 使得元素得到焦点并执行由 onfocus 事件指定的代码。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 关键是我点击的是一个链接:<a href="/site/ViewResource.do?accountId=<bean:write name="resourceBean" property="accountId"/>&resourceId=<bean:write name="resourceBean" property="id"/>#add">add comment</a>怎么能够同时执行focus方法? <a onclick="test('/site/ViewResource.do?accountId=<bean:write name="resourceBean" property="accountId"/>&resourceId=<bean:write name="resourceBean" property="id"');">function test(url) { location.href=url; obj.focus();} 我现在修改如下:<SCRIPT LANGUAGE="JavaScript">function test() { //location.href=url; var obj2=document.getElementsByName("comments"); if (obj2[0].type=="textarea") { obj2[0].focus() }}</SCRIPT><a onclick="test()" href="/site/ViewResource.do?accountId=<bean:write name="resourceBean" property="accountId"/>&resourceId=<bean:write name="resourceBean" property="id"/>#add">想把焦点定位到comments内,但现在锚点可以正确定位,但焦点没有定位到comments内,请问那里不对呢? <SCRIPT LANGUAGE="JavaScript">function test(url) { window.location.href=url; var obj2=document.getElementsByName("comments"); if (obj2[0].type=="textarea") { obj2[0].focus() }}</SCRIPT><a onclick="test('/site/ViewResource.do?accountId=<bean:write name="resourceBean" property="accountId"/>&resourceId=<bean:write name="resourceBean" property="id"/>#add');">add comment</a>第一次不能定位焦点,第二次以后都可以,怎么回事呢? javascript中encodeURI与decodeURI的问题 如何在IE浏览器下载Cab包之前弹出一个提示框,急~~~~~!谢谢! function addLoadEvent(func)这个函数什么意思 如何实现动态的字体颜色设置 这代码错在哪里了?帮忙找下错谢谢啦 JS兼容性问题 如何使用javascript打印框架网页 求连动下拉框技术js代码分不够另开帖再加 关于脚本文件 关于JS函数传值 怎样在一个窗口中显示另一个窗口中的iframe的内容? 高手帮忙看看这段代码错在哪儿?我把“array[3]=4;”删掉就不出错了,可是为什么array[3]=4;有错呢?
<a href="/site/ViewResource.do?accountId=<bean:write name="resourceBean" property="accountId"/>&resourceId=<bean:write name="resourceBean" property="id"/>#add">add comment</a>
怎么能够同时执行focus方法?
function test(url) {
location.href=url;
obj.focus();
}
<SCRIPT LANGUAGE="JavaScript">
function test() {
//location.href=url;
var obj2=document.getElementsByName("comments");
if (obj2[0].type=="textarea")
{
obj2[0].focus()
}
}
</SCRIPT>
<a onclick="test()" href="/site/ViewResource.do?accountId=<bean:write name="resourceBean" property="accountId"/>&resourceId=<bean:write name="resourceBean" property="id"/>#add">
想把焦点定位到comments内,但现在锚点可以正确定位,但焦点没有定位到comments内,请问那里不对呢?
function test(url) {
window.location.href=url;
var obj2=document.getElementsByName("comments");
if (obj2[0].type=="textarea")
{
obj2[0].focus()
}}
</SCRIPT>
<a onclick="test('/site/ViewResource.do?accountId=<bean:write name="resourceBean" property="accountId"/>&resourceId=<bean:write name="resourceBean" property="id"/>#add');">add comment</a>
第一次不能定位焦点,第二次以后都可以,怎么回事呢?