JS:焦点在打开网页时立即消失

时间:2017-07-18 05:08:33

标签: javascript jquery html

我现在正在使用w2ui库和JQuery用于网络。

当我使用w2ui制作表单时,它在Internet Explorer上运行正常。 然而,在Chrome上,即使我点击某个输入框,它也无法立即失去焦点,我无法知道焦点在哪里!

然后,当我刷新时,它突然显示出焦点......它太奇怪了......我不明白它上面发生了什么。

控制台上没有显示任何内容,没有日志,也没有出现错误。 Chrome在加载时是否与IE有所不同?

 <!DOCTYPE html>
 <html lang="en">
 <head>
 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 </head>
 <body>
<div class="w2ui-page page-0">
    <div>
        <div id="title1" class="sub_title"></div>
        <!--<div class="w2ui-field w2ui-span6">
            <label for="connect_type">Connect Type</label>
            <div>
                <select name="connect_type">
                    <option value="0">udp</option>
                    <option value="1">tcp</option>
                </select>
            </div>
        </div>-->
        <div class="w2ui-field w2ui-span6">
            <label for="registrar_ip">Registrar</label>
            <div>
                <input name="registrar_ip" type="text" size="20" maxlength="30" />:
                <input name="registrar_port" type="text" size="5" maxlength="5" />
            </div>
        </div>
        <div class="w2ui-field w2ui-span6" id="proxy">
            <label for="proxy_ip">Proxy</label>
            <div>
                <input name="proxy_ip" type="text" size="20" maxlength="30" />:
                <input name="proxy_port" type="text" size="5" maxlength="5" />
            </div>
        </div>
        <div class="w2ui-field w2ui-span6">
            <label for="outbound_proxy_ip">Outbound Proxy</label>
            <div>
                <input name="outbound_proxy_ip" type="text" size="20" maxlength="30" />:
                <input name="outbound_proxy_port" type="text" size="5" maxlength="5" />
            </div>
        </div>
        <!--<div class="w2ui-field w2ui-span6">
            <div>
                <input name="loose_routing_enabled" type="checkbox" />
                <span> Use Loose Routing</span>
            </div>
        </div>-->
        <!--<div class="w2ui-field w2ui-span6">
            <label for="connect_type2">Connect Type</label>
            <div>
                <select name="connect_type2">
                    <option value="0">udp</option>
                    <option value="1">tcp</option>
                </select>
            </div>
        </div>-->
        <div class="w2ui-field w2ui-span6" id="presence">
            <label for="presence_ip">Presence</label>
            <div>
                <input name="presence_ip" type="text" size="20" maxlength="30" />:
                <input name="presence_port" type="text" size="5" maxlength="5" />
            </div>
        </div>
        <div class="w2ui-field w2ui-span6">
            <label for="sms_ip">SMS</label>
            <div>
                <input name="sms_ip" type="text" size="20" maxlength="30" />:
                <input name="sms_port" type="text" size="5" maxlength="5" />
            </div>
        </div>
        <div class="w2ui-field w2ui-span6">
            <label for="outbound_proxy_sms_ip">Outbound Proxy<br>For SMS</label>
            <div>
                <input name="outbound_proxy_sms_ip" type="text" size="20" maxlength="30" />:
                <input name="outbound_proxy_sms_port" type="text" size="5" maxlength="5" />
            </div>
        </div>
        <!--<div class="w2ui-field w2ui-span6">
            <div>
                <input name="loose_routing2_enabled" type="checkbox" />
                <span> Use Loose Routing</span>
            </div>
        </div>-->
        <div class="w2ui-field w2ui-span6" id="sms_user_field" style="display: none">
            <label for="sms_user">SMS User</label>
            <div>
                <input name="sms_user" type="text" size="5" maxlength="5" />
            </div>
        </div>
    </div>

    <div>
        <div id="title2" class="sub_title"></div>
        <div class="w2ui-field w2ui-span6">
            <label for="private_registrar_ip">Registrar</label>
            <div>
                <input name="private_registrar_ip" type="text" size="20" maxlength="30" />:
                <input name="private_registrar_port" type="text" size="5" maxlength="5" />
            </div>
        </div>
        <div class="w2ui-field w2ui-span6" id="private_proxy">
            <label for="private_proxy_ip">Proxy</label>
            <div>
                <input name="private_proxy_ip" type="text" size="20" maxlength="30" />:
                <input name="private_proxy_port" type="text" size="5" maxlength="5" />
            </div>
        </div>
        <div class="w2ui-field w2ui-span6">
            <label for="private_outbound_proxy_ip">Outbound Proxy</label>
            <div>
                <input name="private_outbound_proxy_ip" type="text" size="20" maxlength="30" />:
                <input name="private_outbound_proxy_port" type="text" size="5" maxlength="5" />
            </div>
        </div>
        <div class="w2ui-field w2ui-span6" id="private_presence">
            <label for="private_presence_ip">Presence</label>
            <div>
                <input name="private_presence_ip" type="text" size="20" maxlength="30" />:
                <input name="private_presence_port" type="text" size="5" maxlength="5" />
            </div>
        </div>
        <div class="w2ui-field w2ui-span6">
            <label for="private_sms_ip">SMS</label>
            <div>
                <input name="private_sms_ip" type="text" size="20" maxlength="30" />:
                <input name="private_sms_port" type="text" size="5" maxlength="5" />
            </div>
        </div>
        <div class="w2ui-field w2ui-span6">
            <label for="private_outbound_proxy_sms_ip">Outbound Proxy<br>For SMS</label>
            <div>
                <input name="private_outbound_proxy_sms_ip" type="text" size="20" maxlength="30" />:
                <input name="private_outbound_proxy_sms_port" type="text" size="5" maxlength="5" />
            </div>
        </div>
    </div>
</div>
<div class="w2ui-buttons">
    <button class="btn" name="save">Save</button>
    <button class="btn" name="reset">Cancel</button>
</div>  
</body>
</html>

我不知道html代码是否对助手有用..

0 个答案:

没有答案