调用外部Jquery代码 [英] Call External Jquery code

查看:77
本文介绍了调用外部Jquery代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为jq1的jquery文件

输入这是文件中的代码

i have jquery file called jq1
iput this is code inside the file

$(document).ready(function () {
            $('#album-list').click(function () { alert("test"); });
            $("#target").click(function () {alert("Handler for .click() called.");});
        });

然后进入我的aspx页面

i put reference

then in my aspx page
i put reference

<script src="Scripts/jquery-1.8.2.js"></script>
<script src="Scripts/jq1.js"></script>

<body>
    <img id="album-list" src="Images/orderedList3.png" />
    <div id="target">
        Click here
    </div>
    
</body>



当我点击图片或div我没有得到提醒信息

有人能告诉我是什么问题


when i click on the image or div i didn't get the alert message
can anybody tell me what is the problem

推荐答案

document ).ready( function (){
(document).ready(function () {


' #album-list')。click( function (){alert( test); });
('#album-list').click(function () { alert("test"); });


#target)。click ( function (){alert( .click的处理程序()叫。);});
});
("#target").click(function () {alert("Handler for .click() called.");}); });

然后在我的aspx页面中

i put reference

then in my aspx page
i put reference

<script src="Scripts/jquery-1.8.2.js"></script>
<script src="Scripts/jq1.js"></script>

<body>
    <img id="album-list" src="Images/orderedList3.png" />
    <div id="target">
        Click here
    </div>
    
</body>



当我点击图片或div我没有收到提醒信息

有人可以告诉我是什么问题


when i click on the image or div i didn't get the alert message
can anybody tell me what is the problem


这篇关于调用外部Jquery代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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