$ .document为null [英] $.document is null

查看:80
本文介绍了$ .document为null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打开我的页面时,我收到错误:$ .document为null。为什么?其次,有没有办法确定下面给出的代码从哪个路径加载文件filevalues.php?

When I open my page, I get error: $.document is null. Why? Secondly, is there any way to determine from which path the below given code is loading the file "filevalues.php"?

<script type="text/javascript">
try {
    $(document).ready(function(){
    $("#Edit").click(function(){
    $.get('fetchvalues.php', null, function(){
    alert('reached');
});
});
});
}
catch(e)
{
alert(e.message);
}
</script>


推荐答案

首先,没有<$ code> $。文件。我认为你的意思是 $(文件),因为那是你的代码所说的......?

First of all, there's no such thing as $.document. I take it you mean $(document), since that's what your code says...?

如果 $(document)不起作用,你的jQuery库没有正确加载,或者与覆盖 $的值的其他内容冲突。如果 jQuery(文档)也不起作用,那么问题就是前者。

If $(document) doesn't work, your jQuery library isn't being loaded correctly, or it's in conflict with something else that overwrites the value of $. If jQuery(document) also isn't working, then the problem is the former.

Firefox的Firebug是一个非常好的工具来追查这样的问题。您可以重新加载页面并查看正在生成的jquery js文件的请求,查看它正在请求的确切路径,以及它在响应中收到的确切内容。

Firefox's Firebug is a very good tool to trace down issues like that. You can reload the page and see the request for the jquery js file being made, see exactly what path it is requesting, and exactly what it receives in response.

这篇关于$ .document为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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