未捕获的TypeError: Cannot read property '的定义
Uncaught TypeError: Cannot read property 'className' of undefined?
$(document).on("click", '.goToInvocationList', function(){
<a href="#" id="create">Create slides</a>
});
此链接在加载页面后由ajax添加当我点击这个链接时,它应该创建幻灯片但它给了我这个错误未捕获的类型错误:无法读取未定义的属性"className"。但是当我把click事件放在一个没有javascript附加的链接上时,它会正常工作
$(document).on("click", '.go-invoice', function(){
sildes_create();
document.location.href='#invoce';
});
<div class="swiper-container">
<div class="swiper-wrapper"></div>
<span class="pagination"></span>
</div>
<script>
function sildes_create(){
count = 4;
var mySwiper = new Swiper('.swiper-container',{
pagination: '.pagination',
paginationClickable: true
});
for ( var i =0; i < 3; i++){
mySwiper.createSlide('<div class="title" style="color:#000">Slide '+ (++count)+'</div>', 'swiper-slide #000-slide').insertAfter(0);
}
}
</script>
在创建链接后添加侦听器:
$(document).on("click", '.goToInvocationList', function(){
$(something).append("<a href='#' id='create'>Create slides</a>")
$('#create').on('click',function(){sildes_create();})
});
相关文章:
- 未捕获TypeError: Cannot read property 'geocode'未定义的'
- SailsJs中的错误.TypeError: Cannot read property '的定义
- 未捕获的TypeError: Cannot read property 'top'的定义
- 未捕获的TypeError: Cannot read property '未定义的数据表
- 未捕获的TypeError: Cannot read property 'timing'的定义
- 未捕获的TypeError: Cannot read property 'checked'零
- 未捕获的TypeError: Cannot read property 'top'在引导中单击导航栏时未
- Extjs5 treepanel [Uncaught TypeError: Cannot read property &
- TypeError: Cannot read property 'submit'添加到购物车'
- 添加自定义jquery.验证方法导致Uncaught TypeError: Cannot read property &
- Vue 2和Vue- resource [Cannot read property 'get'未定义的(
- asp:textbox Uncaught TypeError: Cannot read property 'va
- TypeError: Cannot read property 'search' of undefine
- 读取json时出错未捕获类型错误:Cannot read property 'output'的定义
- 未捕获的TypeError: Cannot read property 'current'在选择任何选项
- 未捕获的TypeError: Cannot read property '3'的定义
- jquery-ui.js:12443未捕获的TypeError: Cannot read property 'a
- jquery Uncaught TypeError: Cannot read property 'left
- 未捕获类型错误:Cannot read property 'print'的定义
- TokenInput + Uncaught TypeError: Cannot read property 't