开发者社区> 问答> 正文

关于jquery mobile引入eclipse出错的问题?报错

弱弱的问一句:为何有时候在eclipse中引入jquery.mobile.js的时候,刷新页面会报错呢?平时也是怎么弄的呀~真是奇了怪了~

<!DOCTYPE html>
<html>
<head>
<title>PhoneGap</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" /> <script type="text/javascript" charset="utf-8" src="jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="jquery.mobile-1.2.1.js"></script>
</head>
<script type="text/javascript">
$(document).on("click", "#go", function(){
alert("click");
});
</script>

[17:20:04.525] Empty string passed to getElementById(). @ file:///home/james/workspace/java/JQMDemo/WebContent/jquery.mobile-1.2.1.js:9252

具体报错位置(红色):

// find present pages
var $pages = $( ":jqmData(role='page'), :jqmData(role='dialog')" ),
hash = $.mobile.path.parseLocation().hash.replace("#", ""),
hashPage = document.getElementById( hash );


// if no pages are found, create one with body's inner html

尝试换了引用版本:jquery.mobile-1.3.1.js,问题继续出现。。。。

虽然暂时不影响使用,但心里很是不爽

展开
收起
爱吃鱼的程序员 2020-06-22 18:50:05 443 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    页面和js在同一个文件夹?不指定<spanstyle="color:#E53333;font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;"> charset="utf-8"<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;"><spanstyle="background-color:#FFFFFF;">行不?<spanstyle="background-color:#FFFFFF;"><spanstyle="background-color:#FFFFFF;">

    2020-06-22 18:50:22
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关课程

更多

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载

相关镜像