'MAX<%=率%GT;'不是div中的有效标识符 [英] 'max<%=rate%>' is not a valid identifier in div
本文介绍了'MAX<%=率%GT;'不是div中的有效标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
'max<%=rate%>' is not a valid identifier in div.how to get value from back end via div id.
<pre lang="xml"><div class="various">
<ul class="stars">
<li><a>
<span>5 star</span>
<div class="progressBar" runat="server" id='max<%=rate%>'><div></div></div>
</a>
</li>
<pre lang="xml"><script type="text/javascript">
function progress(percent, element) {
var progressBarWidth = percent * element.width() / 10;
// With labels:
element.find(&amp;#39;div&amp;#39;).animate({ width: progressBarWidth }, 500).html(percent + &amp;quot;%&amp;amp;nbsp;&amp;quot;);
}
$(document).ready(function () {
$(&amp;#39;.progressBar&amp;#39;).each(function () {
//alert(&amp;#39;Hello&amp;#39;);
var bar = $(this);
var max = $(this).attr(&amp;#39;id&amp;#39;);
max = max.substring(3);
progress(max, bar);
});
});
&amp;lt;/script&amp;gt;&lt;/pre&gt;</pre></pre>
推荐答案
(document).ready(function(){
(document).ready(function () {
(& amp; amp;#39; .progressBar& amp; ; amp;#39;)。each(function(){
// alert(& amp; amp;#39; Hello& amp; amp;#39;);
var bar =
(&amp;#39;.progressBar&amp;#39;).each(function () { //alert(&amp;#39;Hello&amp;#39;); var bar =
(this);
var max =
(this); var max =
这篇关于'MAX<%=率%GT;'不是div中的有效标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文