PDA

View Full Version : چرا این مد جاوا اسکریپت تو موزیلا اجرا میشه ولی تو IE مشکل داره و اجرا نمیشه؟



ghasemweb
چهارشنبه 29 تیر 1390, 11:31 صبح
مشکل این کد جاوا اسکرپت تو چیه که تو موزیلا اجرا میشه ولی تو مرورگر مایکرسافت اجرا نمیشه؟؟؟



<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <style > #sher{font-family:Tahoma;font-size:14px;} .corner-circle{ width:auto; -moz-border-radius-bottomleft:6px; -moz-border-radius-bottomright:6px; -moz-border-radius-topleft:6px; -moz-border-radius-topright:6px; } </style> <script type="application/javascript"> ChangeFontFace=function() { var myArray = new Array(); myArray[0] = "arial"; myArray[1] = "tahoma"; myArray[2] = "andalus"; myArray[3] = "IranNastaliq"; var j=0; var p = document.getElementById('sher'); if(!p.style.fontFamily) { p.style.fontFamily="tahoma"; } for(i=0;i<4;i++){ if(p.style.fontFamily==myArray[i]){ if(i<3){j=(i+1);}else{j=0;} p.style.fontFamily=myArray[j]; break; } } } increaseFontSize=function() { var p = document.getElementById('sher'); if(p.style.fontSize) { var s = parseFloat(p.style.fontSize.replace("px","")); } else { var s = 16; } if(s<=30) { s += 2; } p.style.fontSize = s+"px" } decreaseFontSize=function(id) { var p = document.getElementById('sher'); if(p.style.fontSize) { var s = parseFloat(p.style.fontSize.replace("px","")); } else { var s = 16; } if(s>=12) { s -= 2; } p.style.fontSize = s+"px" } ChangeFontColor=function(color){ document.getElementById('sher').style.color="#"+color; } ChangeFontBGColor=function (color){ document.getElementById('tsher').style.backgroundC olor="#"+color; } </script> <body dir="rtl" onselectstart="return false;"> <table align="center" width="700" border="1"> <tr> <td width="130px" valign="top"> <fieldset class="corner-circle"><legend style="font-size:16px;">استایل:</legend> <table width='100%' border='0' cellspacing='2' cellpadding='1'> <tr> <td style="font-weight:bold">فونت:</td> <td> <a href="javascript:ChangeFontFace();" rel="nofollow" title="تغییر قلم" style="font-weight:bold;font-size:30px"> F</a> </td> </tr> <tr> <td style="font-weight:bold"> اندازه: </td> <td> <a href="javascript:increaseFontSize();" rel="nofollow" title="افزایش" style="font-weight:bold;font-size:30px" /> A</a> &nbsp; <a href="javascript:decreaseFontSize();" rel="nofollow" title="کاهش" style="font-weight:bold;font-size:20px" /> A</a> </td> </tr><tr> <td colspan="2" style="font-weight:bold"> رنگ قلم: <br> <a href="javascript:ChangeFontColor('890208');" rel="nofollow" > <span style="background: none repeat scroll 0% 0% rgb(137, 2, 8); height: 20px;border:solid 1px;" title=" انتخاب رنگ قلم " >&nbsp;&nbsp;&nbsp;</span></a> <a href="javascript:ChangeFontColor('162779');" rel="nofollow"> <span style="background: none repeat scroll 0% 0% rgb(22, 39, 121); height: 20px;border:solid 1px;" title=" انتخاب رنگ قلم " >&nbsp;&nbsp;&nbsp;</span></a> <a href="javascript:ChangeFontColor('A9CBF6');" rel="nofollow"> <span style="background: none repeat scroll 0% 0% rgb(169, 203, 246); height: 20px;border:solid 1px;" title=" انتخاب رنگ قلم " >&nbsp;&nbsp;&nbsp;</span></a> <a href="javascript:ChangeFontColor('13800D');" rel="nofollow"> <span style="background: none repeat scroll 0% 0% rgb(19, 128, 13); height: 20px;border:solid 1px;" title=" انتخاب رنگ قلم " >&nbsp;&nbsp;&nbsp;</span></a> <a href="javascript:ChangeFontColor('7F4680');" rel="nofollow"> <span style="background: none repeat scroll 0% 0% rgb(127, 70, 128); height: 20px;border:solid 1px;" title=" انتخاب رنگ قلم " >&nbsp;&nbsp;&nbsp;</span></a> <a href="javascript:ChangeFontColor('B9BB55');" rel="nofollow"> <span style="background: none repeat scroll 0% 0% rgb(185, 187, 85); height: 20px;border:solid 1px;" title=" انتخاب رنگ قلم " >&nbsp;&nbsp;&nbsp;</span></a> <a href="javascript:ChangeFontColor('000000');" rel="nofollow"> <span style="background: none repeat scroll 0% 0% rgb(0, 0, 0); height: 20px;border:solid 1px;" title=" انتخاب رنگ قلم " >&nbsp;&nbsp;&nbsp;</span></a> </td> </tr><tr> <td colspan="2" style="font-weight:bold"> رنگ پس زمینه: <br> <a href="javascript:ChangeFontBGColor('FFEDEE');" rel="nofollow"> <span style="background: none repeat scroll 0% 0% rgb(255, 237, 238);height: 20px;border:solid 1px;" title=" رنگ پس زمینه ">&nbsp;&nbsp;&nbsp;</span></a> <a href="javascript:ChangeFontBGColor('ECEAFF');" rel="nofollow"> <span style="background: none repeat scroll 0% 0% rgb(236, 234, 255);height: 20px;border:solid 1px;" title=" رنگ پس زمینه ">&nbsp;&nbsp;&nbsp;</span></a> <a href="javascript:ChangeFontBGColor('E7F6F5');" rel="nofollow"> <span style="background: none repeat scroll 0% 0% rgb(231, 246, 245);height: 20px;border:solid 1px;" title=" رنگ پس زمینه ">&nbsp;&nbsp;&nbsp;</span></a> <a href="javascript:ChangeFontBGColor('E7FFE7');" rel="nofollow"> <span style="background: none repeat scroll 0% 0% rgb(231, 255, 231);height: 20px;border:solid 1px;" title=" رنگ پس زمینه ">&nbsp;&nbsp;&nbsp;</span></a> <a href="javascript:ChangeFontBGColor('F5E1FF');" rel="nofollow"> <span style="background: none repeat scroll 0% 0% rgb(245, 225, 255);height: 20px;border:solid 1px;" title=" رنگ پس زمینه ">&nbsp;&nbsp;&nbsp;</span></a> <a href="javascript:ChangeFontBGColor('FDFFDE');" rel="nofollow"> <span style="background: none repeat scroll 0% 0% rgb(253, 255, 222);height: 20px;border:solid 1px;" title=" رنگ پس زمینه ">&nbsp;&nbsp;&nbsp;</span></a> <a href="javascript:ChangeFontBGColor('FFFFFF');" rel="nofollow"> <span style="background: none repeat scroll 0% 0% rgb(255, 255, 255);height: 20px;border:solid 1px;" title=" رنگ پس زمینه ">&nbsp;&nbsp;&nbsp;</span></a> </td></tr></table> </fieldset> <script > //disableSelection(); </script> </td> <td valign="top"> <div id="sher" style="-moz-user-select: none; cursor: default;" > <br /> <p>&nbsp;</p> <br /> <p>ای دل که «منم» مینوشی!</p> <br /> <p>بـر مـن تـو دروغکی قـسم مینـوشـی</p> <br /> <p>دیــری نشود کــه سنـگ بیـصدا تـو را هم کـوبـد</p> <br /> <p>دیری نشود تو هم درین عرصه ی حق تیغ دو دم مینوشی</p> <br /> <p>زیـرا کــه حقیـقت&nbsp; ز تـو&nbsp; هر لحظه&nbsp; شکایت دارد</p> <br /> <p>زیــرا کــه بسی خـون قـلم مینوشی</p> <br /> <p>بـدبـخت! عـدم&nbsp; مینـوشی!</p> <br /> <p>&nbsp;</p> <br /> <p >&nbsp;</p></div > </td> </tr> </table> </body></html>

ghasemweb
چهارشنبه 29 تیر 1390, 13:15 عصر
مشکل از این قسمت بوده.

<script type="application/javascript">



اصلاح شود به این شکل:



<script type="text/javascript">



نمیدونم چرا هر وقت سوال میپرسم کسی جواب نمیده آخرش خودم مشکلم رو حل میکنم.