gpt4 book ai didi

jQuerymobile : The alert in mobile safari shows -- file://null

转载 作者:行者123 更新时间:2023-12-01 04:56:08 25 4
gpt4 key购买 nike

当我在 html 文件中的 JQM 中添加警报并将其运行到 mobile safari 中时,它会显示一个警报(类似于 iphone Alertview)。标题显示:file://(null)

谁能解释一下吗?提前致谢

编辑:请引用下面的代码:

$(function() {
$('#theButton').click(function() {
alert('The Button has been clicked');

});
});

最佳答案

您使用的 jquery mobile 语法不正确。 Here你会发现为什么是 $(document).ready(function(e) {$(function() { 未在 jQuery Mobile 中使用。jQuery mobile 语法应如下所示:

<script>
$(document).live("mobileinit", function () {
$('#index').live('pagebeforeshow',function(e,data){
$('#test-button').live('click', function(e) {
alert('Button works!');
});
});
});
</script>

这应该可以正常工作,没有错误标题。

看一下这个 fiddle 示例:http://jsfiddle.net/Gajotres/DE4M7/

关于jQuerymobile : The alert in mobile safari shows -- file://null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14039776/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com