我打算让ASP AJAX聊天没有java脚本......但...... [英] I was gonna make ASP AJAX Chat no java script... but ...

查看:54
本文介绍了我打算让ASP AJAX聊天没有java脚本......但......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要制作ASP AJAX聊天没有java脚本...但是每次使用ajax页面加载列表框时它会集中,所以我的文本框没有聚焦。是的,我为文本框设置了focus(),但是管道栏从单词的开头开始...... ??



为什么textBox总是从一开始就集中注意力word?

I was gonna make ASP AJAX Chat no java script... but listbox every time page load with ajax it's focused so my textbox is not focused. yes i set focus() for textbox but also the pipe bar starts from begin of words...... ??

why textBox always focused from the beginning of word ?

推荐答案

我在对这个问题的评论中解释了你的主要问题。



至于管道栏的问题,你的问题是:你不明白它是什么。没有管道栏。这称为插入符号设置插入符号与聚焦完全无关。当你看到插入符号时,控件已经集中。这是键盘焦点,没有别的。



这是你可以将插入符号设置为任意有效的文本点输入 control(文本框):

I explained your major problem in my comment to the question.

As to the problem of "pipe bar", your problem is: you don't understand what it is. There is no a "pipe bar". This is called caret. Setting a caret is totally unrelated to "focusing". When you see a caret, a control is already focused. This is the keyboard focus and nothing else.

This is how you can set a caret to an arbitrary valid point of text input control (text box):
function setCaret(input, column) {
        input.setSelectionRange(column, column);
} //setCaret



请参阅: setSelectionRange - Mozilla | MDN [ ^ ]。



我们不会讨论任何废话,例如不存在的java脚本或您想要和不想使用的内容。在声明这些东西之前,你必须先了解用于什么的东西。



-SA


这篇关于我打算让ASP AJAX聊天没有java脚本......但......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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