【发布时间】:2014-03-07 17:19:12
【问题描述】:
我正在测试这个 jQuery 代码,但它没有运行。我打开了控制台(F12),在我粘贴了测试代码后,它完美地编译了它。虽然我删除了 src="http://code.jquery.com/jquery-latest.min.js" 并从 $(document).ready(function(){ 中获取警报然后警报有效,但我明白了来自控制台的消息:“Uncaught ReferenceError: $ is not defined”。我想知道这是为什么?请帮忙?
这是我的测试代码:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js">
$(document).ready(function(){
alert('Hi!');
$("#content").append('<div class=\'toolbarBox toolbarHead\' style=\'background-color: #F8F8F8;border: 1px solid #CCCCCC;margin-bottom: 10px;padding: 5px 0;border-radius: 3px;-moz-border-radius: 3px;-webkit-border-radius: 3px;-o-border-radius: 3px;position: relative;\'><div class=\'pageTitle\'><h3 style = \'font-size: 1.6em;font-weight: normal;line-height: 52px;text-shadow: 0 1px 0 #fff;\'><span id=\'current_obj\' style=\'font-weight: normal;\'><span class=\'breadcrumb item-0\'>My Affiliates<img alt=\'>\' style=\'margin-right:5px\' src=\'../img/admin/separator_breadcrumb.png\'></span><span class=\'breadcrumb item-1\'>Affiliates</span></span></h3></div></div>');
$("#content").append("<iframe style=\'width: 100%;height: 100%;\' src=\'http://www.myaffiliates.gr/\'></iframe>");
});
【问题讨论】:
标签: javascript jquery