$未在JavaScript中定义 [英] $ not defined in JavaScript

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

问题描述

Firebug报告

$未定义
[在此错误中突破] $(function(){

$ is not defined [Break On This Error] $(function(){

我有一个简单的index.php页面,它包含php包含我需要的内容。

I have a simple index.php page that does a php include to include the contents I need.

内容如下:

<script type="text/javascript">
$(function(){
    $("#ipad").submit(function() {
        $.post("ipadcheck.php", $("#ipad").serialize(),
        function(data) {
            if(data.error == 'TRUE') {  
                    $("#results_ajax").html("<div class='AppleRedBold'>Sorry There were     Errors: " + data.error_message + "</div>");
            } else {
                $("#results_ajax").html("<div class='AppleRedBold'>" + data.display + "    </div>");
            }
        }, "json");

        return false;

    });
});
</script>

<div class="paragraph_style" id="results_ajax"></div>

    <div class="paragraph_style">
        <form id="ipad" name="ipad">
                <label class="paragraph_style" for="txtZip">Zip Code:     </label>
                <input class="searchBox Black" id="txtZip" name="txtZip" type="text" />
                <br /><br />
                <input type="submit" value="Submit">
        </form>
    </div>                  
</div>

我在其他地方这样做,我很好。我不明白错误.....

I do this in other places and I am fine. I don't understand the error.....

推荐答案

您是否包含了jQuery库?

Did you include the jQuery library?

这篇关于$未在JavaScript中定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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