简体   繁体   English

jQuery可在Internet Explorer中使用,但不能在Chrome和Firefox中使用

[英]jQuery works in Internet Explorer but not in Chrome and Firefox

I have written the following very simple jQuery post. 我写了以下非常简单的jQuery帖子。 It works in Internet Explorer but not in either Chrome or Firefox: 它适用于Internet Explorer,但不适用于Chrome或Firefox:

<script>
function showphone(){
    $.post('phonedata.php',{    
        k: document.getElementById('k').value,
        s: document.getElementById('s').value
    },
    function(output){
        $('#showphone').html(output);
    }); 
}
showphone();
</script>

Is there anything that I can do for Chrome and Firefox? 我可以为Chrome和Firefox做任何事情吗?

Try 尝试

$(document).ready(function(e) {
showphone();
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 提交按钮不适用于Chrome或Firefox,但适用于Internet Explorer - The Submit Button doesn't work in Chrome or Firefox, but Works in Internet Explorer chrome,firefox和Internet Explorer中的Ajax和html事件 - Ajax and html events in chrome, firefox and Internet Explorer 这个 PHP 脚本在 Internet Explorer 和 Microsoft Edge 中不起作用,但在 Chrome/Firefox/Safari/Opera 中有效 - This PHP script doesn't work in Internet explorer and Microsoft Edge but works in Chrome/Firefox/Safari/Opera jQuery $ .getJSON在Internet Explorer中仅工作一次 - jquery $.getJSON only works once in internet explorer 登录代码无法在Internet Explorer中使用,但可以在Chrome和Firefox中使用 - Sign-in code not working in Internet Explorer but yes in Chrome and Firefox 图像和进度栏未在Internet Explorer中加载,但在Firefox,Chrome等中加载 - Image & progress bar not loading in internet explorer, but loads in firefox, chrome etc 提交按钮未出现在Firefox中,但出现在Chrome和Internet Explorer上 - Submit button does not appear in Firefox but on Chrome and Internet Explorer Magento Static 块在 Inte.net Explorer 上的位置与 Chrome 上的不同,Firefox - Magento Static Block is at a Different Place on Internet Explorer than on Chrome, Firefox jQuery ajax可在Chrome中使用,但不能在Firefox或IE中使用 - jQuery ajax works in Chrome but not Firefox or IE 使用或按钮标记或jQuery从Google Chrome打开Internet Explorer - Open Internet Explorer from Google Chrome using a or button tag or jQuery
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM