duandun3178 2014-12-07 10:00
浏览 111
已采纳

我的jquery代码不能在任何浏览器中运行

my jquery is not working in any browser i reffered many answers on web for it none helped me out..!!

This is my code in the index file i tried in both (index.html) and (index.php)

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Jquery</title>
</head>
<body>
<div id="message" style="display:none;"> Welcome to my site</div>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/fade.js"></script>

</body>
</html>

the javascript files were in js folder.

And the fade.js code was :-

$(document).ready(function() {
$('#message').fadeIn('slow'); 
});

and the jquery code was which i downloaded from jquery website i tried the production both versions 1 and 2 and also other source links like

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>

also jquery source links which some users uses. also i tried to shift the script code above the tags. but whatever it is i tried not working in any browsers.

Please Help me out guys...!!

  • 写回答

3条回答 默认 最新

  • dongsiju1941 2014-12-07 10:04
    关注

    fucntion should be function & load the jQuery before your script.

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
    $(document).ready(function() {
                      /*^^^^^^*/
        $('#message').fadeIn('slow');
    });
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛