我在 JQUERY 中有这段代码:
var large='<div class="vip" style ="background:url(./uploads/deal/"+data[a].id+"_1.jpg);">
<span class ="coundtown" value ='+data[a].deal_time_off+' style ="display:none;"></span>
<script> $(document).ready(function(){ $('+data[a].deal_unique_id+').countdown({ date:'+data[a].deal_time_off+'}); }); </script>
<div class = "deal_info clearfix">
<div class = "deal_subject clearfix">
<a href="./deal/'+data[a].deal_unique_id+'">adsfd</a>
</div>
<div style = "clear:both"></div>
<div class="timer">
<img class="img" src="./img/stopwatch.png" border="none" />
<span class ='+data[a].deal_unique_id+'></span>
</div>
</div>
<div class="percent_mini"></div>
</div>';
//$("#left_row").append(large);
但在这一行:
<span class ="coundtown" value ='+data[a].deal_time_off+' style ="display:none;">
我收到此错误:
未捕获的 SyntaxError:意外的保留字
问题是什么?
var large='<div class="vip" style ="background:url(http://mydeal.ge/uploads/deal/"+data[a].id+"_1.jpg);">
<span class ="coundtown" value ="'+data[a].deal_time_off+'" style ="display:none;"></span>
<script> $(document).ready(function(){ $("'+data[a].deal_unique_id+'").countdown({ date:"'+data[a].deal_time_off+'"}); }); </script>
<div class = "deal_info clearfix">
<div class = "deal_subject clearfix">
<a href="http://mydeal.ge/deal/'+data[a].deal_unique_id+'">adsfd</a>
</div>
<div style = "clear:both"></div>
<div class="timer">
<img class="img" src="http://mydeal.ge/img/stopwatch.png" border="none" />
<span class ="'+data[a].deal_unique_id+'"></span>
</div>
</div>
<div class="percent_mini"></div>
</div>';
我修复了这个变量,但仍然出现错误