PDA

View Full Version : سوال: چرا کد jQuery فقط در "فایرفاکس"اجرا می شود و نه در هیچ مرورگر دیگر ؟



Coldplayer
چهارشنبه 15 مهر 1394, 10:26 صبح
سلام ...من تازه jQuery نویسی رو شروع کردم و تجربه زیادی ندارم و احتمالا سوالم مبتدیانه باشه ولی با سرچ توی سایت های خارجی نتونستم راه حل رو پیدا کنم چون هر کدوم بر اساس قطعه کدی که نوشته بودن سوال میپرسیدن و نه به صورت کلی

من یه کد جیکوئری نوشتم که توی مرورگر فایرفاکس به طور کامل اجرا میشه ولی توی Chrome , Microsoft Edge تست کردم هیچ کدوم اجراش نمی کنن . این هم کدم :


<script>
$(document).ready(function()
{
$.get('Flow.xml', function(d){
$(d).find('User').each(function(){
var html =''
html+= '<div class="font">';
html+= '<div class="content" style="background:#CCFF99">';
html+= '<div class="block AlignR">';
html+= '<div class="marginTop">تاریخ دریافت : '+$(this).attr("Receive")+'</div>';
var DeadL = "آخرین مهلت مشخص نشده است";
if ($(this).attr("Deadline")!=null){DeadL = 'آخرین مهلت : '+$(this).attr("Deadline")};
html+= '<div class="marginBottom">'+DeadL+'</div>';
html+= '</div>';
html+= '<div class="block f1_container">';
html+= '<div class="f1_card">';
var EnvStatus ="Images/EnvelopeOpened.png";
if ($(this).attr("Read")==null){EnvStatus="Images/EnvelopeClose.png"};
var Gender ="آقای ";
if ($(this).attr("Sex")==0){Gender="خانم "};
var ProfilePhoto = $(this).attr("Image");
if ($(this).attr("Sex")==0 && $(this).attr("Image")==null){ProfilePhoto="Images/no-photo-female.jpg"};
if ($(this).attr("Sex")==1 && $(this).attr("Image")==null){ProfilePhoto="Images/no-photo-male.jpg"};
html+= '<div style="background:url('+ProfilePhoto+');background-size:cover" class="circle front face">';
html+= '<span class="Span"><img src="'+EnvStatus+'"width="30" height="30"></span>';
html+= '</div>';
html+= '<div class="back face">';
html+= '<p>'+Gender+''+$(this).attr("FullName")+'</p>';
html+= '<p>واحد : '+$(this).attr("Unit")+'</p>';
html+= '<p>سمت : '+$(this).attr("Role")+'</p>';
html+= '</div>';
html+= '</div>';
html+= '</div>';
html+= '<div class="block AlignL">';
var IconMessage = "نامه ارسالی هنوز خوانده نشده است";
if ($(this).attr("Read")!=null)
{IconMessage ='مشاهده شد : '+$(this).attr("Read");}
html+= '<div class="marginTop">'+IconMessage+'</div>';

html+= '<div class="marginBottom">عملیات درخواستی : '+$(this).attr("Action")+'</div>';
html+= '</div>';
html+= '</div>';
html+= '</div>';
$('#dl').append($(html));
});
});
});
</script>


ممنون میشم اگه دوستان اهل فن راهنماییم کنند