jQuery document.ready停止代码
jQuery document.ready stops the code
我现在遇到的问题是,当我放置document.ready代码包装脚本时,它停止工作。我知道我不能简单地使用它,因为我只在HTML的末尾调用脚本,但我想知道它为什么会破坏我的代码。附言:我已经添加了jQuery代码:
$(document).ready(function () {
$('.clicker').click(function() {
if($(this).hasClass('clicker'))
{
var row_index = $(this).parents('tr').index();
$(this).text('Cancelar');
$(this).attr('class', 'cancelar');
var index = row_index - 2;
$(".save:eq("+index+")").css('display', 'inline');
}
else
{
$(this).text('Editar');
$(this).attr('class', 'clicker');
$('.save').css('display', 'none');
}
});
});
//In the end of the html file:
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.2.3.min.js"></script>
<script src="/js/scripts.js"></script>
$未定义-您正在尝试运行Jquery,但未定义它,这会破坏您的页面-当您尝试运行document.ready.时,脚本在那里失败
相关文章:
- jQuery document.ready停止代码
- 如果事件发生后插入了检查代码,那么$(document).ready()会被激发吗
- $(document).ready() 在 IE 中使用 require.js 优化代码
- 如果代码在底部,那么将 $(document).ready 函数放在底部有什么意义
- 如何从代码隐藏中分配 $(document).ready 中的值
- 在 requirejs 中的 document.ready 之前执行代码
- 将所有代码放在“$(document).ready”中是否安全
- 在 document.ready 中获取隐藏字段的值,asp.net 代码隐藏
- 使用不同的变量值多次执行外部javascript文件中的$(document).ready()中的代码
- 等待第一个事件完成,然后继续使用document.ready代码
- 代码获胜't在$(document).ready中执行,但将在开发人员控制台中执行
- document.ready jquery代码中未定义Javascript函数
- $(document).ready()函数内的代码不适用于AJAX回调
- jquery$(selector).ready()代码即使没有匹配的元素也会运行
- 我的代码是在$document.ready中调用的,但似乎是在加载DOM之前运行的.为什么?
- 在