javascript setFocus()函数在IE6中不起作用 [英] javascript setFocus() function is not working in IE6

查看:90
本文介绍了javascript setFocus()函数在IE6中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网络应用程序的pageload事件中为"html input(type = text)"使用了Java脚本setFocus()函数.当我在IE8中打开页面时,它工作正常.页面为IE6,单击鼠标选择后此功能不起作用,并且光标不闪烁.

-------------------------------------------------- ---

基本上,对于不同的条件和不同的登录类型,文本字段使用的方式不同.此字段已针对代码动态地多次启用,禁用,不可见和可见.对于相同条件,当从IE8打开页面时,光标会闪烁,但是在IE6中以调试模式打开打开时,Java脚本错误显示消息,因为控件已禁用或不可见,无法进行聚焦..............

I have used a java script setFocus() function for a "html input(type=text)" in the pageload event of a web application.It is working fine when I am opening the page in IE8.But when opening the page is IE6 ,this function is not working and the cursor is not blinking after selecting by clicking mouse.

-----------------------------------------------------

Basically the text field is used different way for different condition and different log in type.This field has been made enabled ,disabled and invisible and visible many times dynamically for the code.For same condition when opening the page from IE8 the cursor is blinking but when open opening in IE6 in debugging mode java script error is showing message that focusing cannot be done as the control is either disabled or invisible..............

推荐答案

1.好吧,现在全世界几乎都已转向IE7/8,而您仍在使用IE6?甚至MS也已停止对其提供支持.为什么您仍在使用IE6?

2.关于setFocus()...它曾经在IE6中用于输入元素.您肯定在犯一些错误.请发布代码,以便人们可以找出其中是否缺少任何内容.

应该是这样的:
document.getElementById("thisTextBox").focus();
1. Well, almost the whole world has shifted to IE7/8 now and you are still on IE6? Even MS has stopped giving support to it. Why are you still on IE6?

2. About setFocus()... it used to work in IE6 for an input element. You surely are doing some mistake. Please post the code such that one can figure out if anything missing in it.

It should be something like:
document.getElementById("thisTextBox").focus();


这篇关于javascript setFocus()函数在IE6中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆