برگزیده های پرشین تولز

ولید کردن یک ارور در اسکریپت

WikiVB

Registered User
تاریخ عضویت
26 اکتبر 2011
نوشته‌ها
1,079
لایک‌ها
246
محل سکونت
Bijar
درود
دوستان من در وردپرس از پلاگینی استفاده میکنم هنگام ولید کردن به مشکل میخورم به دلیل وجود & در یکی از خطوط و متاسفانه زیاد js کار نکردم ، دنبال جایگزینی میگردم برای & که مشکل ولید حل بشه و در کار پلاگین هم اختلالی ایجاد نشه چون از جایگزین های xhtml استفاده کردم اما روی کارکرد پلاگین تاثیر داره و خراب میکنه پلاگین رو
این هم اسکریپتی که این مشکل درش هست :
کد:
<script type="text/javascript">
var isProcessing = false;
function alter_ul_post_values(obj,post_id,ul_type){

if (isProcessing)
return;
isProcessing = true;

jQuery(obj).find("span").html("..");
jQuery.ajax({
type: "POST",
url: "<?php echo plugins_url( 'ajax_counter.php' , __FILE__ );?>",
data: "post_id="+post_id+"& up_type="+ul_type,
success: function(msg){
jQuery(obj).find("span").html(msg);
isProcessing = false;
}
});
}
</script>

بخش مورد نظر رو قرمز رنگ کردم
پیشاپیش ممنون
یا حق
 

m.rezakh

Registered User
تاریخ عضویت
2 سپتامبر 2014
نوشته‌ها
256
لایک‌ها
257
محل سکونت
شیراز
درود
دوستان من در وردپرس از پلاگینی استفاده میکنم هنگام ولید کردن به مشکل میخورم به دلیل وجود & در یکی از خطوط و متاسفانه زیاد js کار نکردم ، دنبال جایگزینی میگردم برای & که مشکل ولید حل بشه و در کار پلاگین هم اختلالی ایجاد نشه چون از جایگزین های xhtml استفاده کردم اما روی کارکرد پلاگین تاثیر داره و خراب میکنه پلاگین رو
این هم اسکریپتی که این مشکل درش هست :
کد:
<script type="text/javascript">
var isProcessing = false;
function alter_ul_post_values(obj,post_id,ul_type){

if (isProcessing)
return;
isProcessing = true;

jQuery(obj).find("span").html("..");
jQuery.ajax({
type: "POST",
url: "<?php echo plugins_url( 'ajax_counter.php' , __FILE__ );?>",
data: "post_id="+post_id+"& up_type="+ul_type,
success: function(msg){
jQuery(obj).find("span").html(msg);
isProcessing = false;
}
});
}
</script>

بخش مورد نظر رو قرمز رنگ کردم
پیشاپیش ممنون
یا حق
سلام
بخش مورد نظر قرمز که ما ندیدیم!نیست
اما میتونی از این کد استفاده کنی
کد:
<script type="text/javascript">
var isProcessing = false;
function alter_ul_post_values(obj,post_id,ul_type){

if (isProcessing)
return;
isProcessing = true;
var res = String.fromCharCode(38);
jQuery(obj).find("span").html("..");
jQuery.ajax({
type: "POST",
url: "<?php echo plugins_url( 'ajax_counter.php' , __FILE__ );?>",
data: "post_id="+post_id+res+" up_type="+ul_type,
success: function(msg){
jQuery(obj).find("span").html(msg);
isProcessing = false;
}
});
}
</script>
موفق باشی
 

WikiVB

Registered User
تاریخ عضویت
26 اکتبر 2011
نوشته‌ها
1,079
لایک‌ها
246
محل سکونت
Bijar
سلام
بخش مورد نظر قرمز که ما ندیدیم!نیست
اما میتونی از این کد استفاده کنی
کد:
<script type="text/javascript">
var isProcessing = false;
function alter_ul_post_values(obj,post_id,ul_type){

if (isProcessing)
return;
isProcessing = true;
var res = String.fromCharCode(38);
jQuery(obj).find("span").html("..");
jQuery.ajax({
type: "POST",
url: "<?php echo plugins_url( 'ajax_counter.php' , __FILE__ );?>",
data: "post_id="+post_id+res+" up_type="+ul_type,
success: function(msg){
jQuery(obj).find("span").html(msg);
isProcessing = false;
}
});
}
</script>
موفق باشی
تشکر عزیز ، متاسفانه فراموش کردم قرمز کنم اون بخش رو که خودتون متوجهش شدید ، حل شد مشکل هم سپاسگذارم :x
 

WikiVB

Registered User
تاریخ عضویت
26 اکتبر 2011
نوشته‌ها
1,079
لایک‌ها
246
محل سکونت
Bijar
سلام
بخش مورد نظر قرمز که ما ندیدیم!نیست
اما میتونی از این کد استفاده کنی
کد:
<script type="text/javascript">
var isProcessing = false;
function alter_ul_post_values(obj,post_id,ul_type){

if (isProcessing)
return;
isProcessing = true;
var res = String.fromCharCode(38);
jQuery(obj).find("span").html("..");
jQuery.ajax({
type: "POST",
url: "<?php echo plugins_url( 'ajax_counter.php' , __FILE__ );?>",
data: "post_id="+post_id+res+" up_type="+ul_type,
success: function(msg){
jQuery(obj).find("span").html(msg);
isProcessing = false;
}
});
}
</script>
موفق باشی
عزیز میگم این هم میشه کاری کرد ؟
کد:
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/placeholdem.min.js"></script>
     <script type="text/javascript">
       Placeholdem( document.querySelectorAll( '[placeholder]' ) );

       var fadeElems = document.body.querySelectorAll( '.fade' ),
         fadeElemsLength = fadeElems.length,
         i = 0,
         interval = 50;

         function incFade() {
           if( i < fadeElemsLength ) {
             fadeElems[ i ].className += ' fade-load';
             i++;
             setTimeout( incFade, interval );
           }
         }

         setTimeout( incFade, interval );
     </script>
برای اون < ارور میگیره همچنین راهی برای ولید کردن placeholder هست ؟ کلا دو ارور دارم الان که مربوط به این دو مورد هست
ممنون
 

m.rezakh

Registered User
تاریخ عضویت
2 سپتامبر 2014
نوشته‌ها
256
لایک‌ها
257
محل سکونت
شیراز
عزیز میگم این هم میشه کاری کرد ؟
کد:
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/placeholdem.min.js"></script>
     <script type="text/javascript">
       Placeholdem( document.querySelectorAll( '[placeholder]' ) );

       var fadeElems = document.body.querySelectorAll( '.fade' ),
         fadeElemsLength = fadeElems.length,
         i = 0,
         interval = 50;

         function incFade() {
           if( i < fadeElemsLength ) {
             fadeElems[ i ].className += ' fade-load';
             i++;
             setTimeout( incFade, interval );
           }
         }

         setTimeout( incFade, interval );
     </script>
برای اون < ارور میگیره همچنین راهی برای ولید کردن placeholder هست ؟ کلا دو ارور دارم الان که مربوط به این دو مورد هست
ممنون
یعنی وردپرس به < گیر میده؟؟ فکر نکنم اینجوری باشه ها
این کد بنویس شاید حواب بده
کد:
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/placeholdem.min.js"></script>
     <script type="text/javascript">
       Placeholdem( document.querySelectorAll( '[placeholder]' ) );

       var fadeElems = document.body.querySelectorAll( '.fade' ),
         fadeElemsLength = fadeElems.length,
         i = 0,
         interval = 50;
         function incFade()
    {
        for(i=0;i!=fadeEle,sLength;i++)
        {
                 fadeElems[ i ].className += ' fade-load';                
                 setTimeout( incFade, interval );
        }
         }

         setTimeout( incFade, interval );
     </script>
 

WikiVB

Registered User
تاریخ عضویت
26 اکتبر 2011
نوشته‌ها
1,079
لایک‌ها
246
محل سکونت
Bijar
یعنی وردپرس به < گیر میده؟؟ فکر نکنم اینجوری باشه ها
این کد بنویس شاید حواب بده
نه ولیداترو به اون > داخل js گیر میداد که به لطف شما حل شد
الان فقط این ارور رو دارم که ظاهرا placeholder رو ولیداتور کلا گیر میده درسته ؟

  1. Line 90, Column 32:there is no attribute "placeholder"
<input type="text" placeholder="جستجو ..." class="searchinput" size="18" name="…
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see theFAQ item on valid flash
 

m.rezakh

Registered User
تاریخ عضویت
2 سپتامبر 2014
نوشته‌ها
256
لایک‌ها
257
محل سکونت
شیراز
نه ولیداترو به اون > داخل js گیر میداد که به لطف شما حل شد
الان فقط این ارور رو دارم که ظاهرا placeholder رو ولیداتور کلا گیر میده درسته ؟
  1. Line 90, Column 32:there is no attribute "placeholder"
<input type="text" placeholder="جستجو ..." class="searchinput" size="18" name="…
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see theFAQ item on valid flash
حالا که دارم فکر میکنم این کدی که من نوشتم اشتباه هست
شما همون کد قبلی خودتو بنویس، اگر به < گیر میده با if else بنویس دیگه به < نیازی نیست
دوست عزیز من تا حالا تگ placeholder داخا html ندیده بودم(احتمالا از کم تجربگی و تازه کار بودن منه)، احتماالا این تگ داخل css تعریف شده و شما اون فایل css نداری
 

m.rezakh

Registered User
تاریخ عضویت
2 سپتامبر 2014
نوشته‌ها
256
لایک‌ها
257
محل سکونت
شیراز
داخل اون کدی هم که به & گیر میداد، میتونی همون کد قبل بنویسی و بجای & از amp& استفاده کنی
 

WikiVB

Registered User
تاریخ عضویت
26 اکتبر 2011
نوشته‌ها
1,079
لایک‌ها
246
محل سکونت
Bijar
حالا که دارم فکر میکنم این کدی که من نوشتم اشتباه هست
شما همون کد قبلی خودتو بنویس، اگر به < گیر میده با if else بنویس دیگه به < نیازی نیست
دوست عزیز من تا حالا تگ placeholder داخا html ندیده بودم(احتمالا از کم تجربگی و تازه کار بودن منه)، احتماالا این تگ داخل css تعریف شده و شما اون فایل css نداری
داخل اون کدی هم که به & گیر میداد، میتونی همون کد قبل بنویسی و بجای & از amp& استفاده کنی

نه هر دو کدی که دادید رو تغیییر دادم و هم مشکلم حل شد هم پلاگین به درستی کار میکنه جایی اشتباه نکردید شما amp& استفاده کردم اما قبول نمیکد ، الان موردی نداره حله
placeholder رو تو input مربوط به سرچ استفاده کردم یعنی میفرمایید باید در css استفاده بشه و نباید تو html باشه ؟
 

m.rezakh

Registered User
تاریخ عضویت
2 سپتامبر 2014
نوشته‌ها
256
لایک‌ها
257
محل سکونت
شیراز
نه هر دو کدی که دادید رو تغیییر دادم و هم مشکلم حل شد هم پلاگین به درستی کار میکنه جایی اشتباه نکردید شما amp& استفاده کردم اما قبول نمیکد ، الان موردی نداره حله
placeholder رو تو input مربوط به سرچ استفاده کردم یعنی میفرمایید باید در css استفاده بشه و نباید تو html باشه ؟
پیغامی که داده نوشته :
<input type="text" placeholder="جستجو ..." class="searchinput" size="18" name="…
شما تگ با placeholder بستی
فکر کنم منظور شما این بوده و اشتباه نوشتی :
<inputtype="text"name="lname"placeholder="Last name">
اگر نمیخای داخل placeholder چیزی بنویسی او placeholder که گذاشتی بردار
 

WikiVB

Registered User
تاریخ عضویت
26 اکتبر 2011
نوشته‌ها
1,079
لایک‌ها
246
محل سکونت
Bijar
پیغامی که داده نوشته :
<input type="text" placeholder="جستجو ..." class="searchinput" size="18" name="…
شما تگ با placeholder بستی
فکر کنم منظور شما این بوده و اشتباه نوشتی :
<inputtype="text"name="lname"placeholder="Last name">
اگر نمیخای داخل placeholder چیزی بنویسی او placeholder که گذاشتی بردار
نه اقا اینجا که کپی کردم اینجوری شده در واقع این مدلی هست :
کد:
<input type="text" placeholder="جستجو ..." class="searchinput" size="18" name="…
 

m.rezakh

Registered User
تاریخ عضویت
2 سپتامبر 2014
نوشته‌ها
256
لایک‌ها
257
محل سکونت
شیراز
نه اقا اینجا که کپی کردم اینجوری شده در واقع این مدلی هست :
کد:
<input type="text" placeholder="جستجو ..." class="searchinput" size="18" name="…
دیگه اینو نمیدونم!
چه اجباریه، قسمت placeholder پاک کن!
 

WikiVB

Registered User
تاریخ عضویت
26 اکتبر 2011
نوشته‌ها
1,079
لایک‌ها
246
محل سکونت
Bijar
دیگه اینو نمیدونم!
چه اجباریه، قسمت placeholder پاک کن!
جای value از placeholder استفاده کردم و بهش افکتی دادم که وقتی روش کلیک میشه placeholder حرف به حرف پاک میشه متاسفانه باید برش دارم چون راهی نیست ولیداتور کلا ایراد میگیره از placeholder
آقا ممنون مشکلات اساسی رو حل کردید برام :general504:
 
بالا