הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   [JS] 2 שאלות בנוגע למחרוזת. (https://hosts.co.il/forums/showthread.php?t=25450)

miniature 02-07-06 00:55

[JS] 2 שאלות בנוגע למחרוזת.
 
1.
HTML קוד:

document.getElementById('divname').innerHTML = document.getElementById('divname').innerHTML.replace('/span/i','');
לא עובד..

2.
HTML קוד:

      var search_value = "asd";
      var search_with = '<span class="search_res">'+search_value.charAt(0)+'<!---->'+search_value.substr(1)+'</span>';
      while(indexOf(search_with) > -1) {

לא עובד..


---
תודה רבה לעוזרים.

eLad 03-07-06 09:39

הממ

1.

קוד:

<script>
 var str = "eaeaeaea";
 var strAfterFormat = str.replace(/e/g,'b')
 alert(strAfterFormat);
</script>

2. לא הבנתי מה ניסית לעשות

miniature 04-07-06 18:29

ציטוט:

נכתב במקור על ידי eLad
הממ

1.

קוד:

<script>
 var str = "eaeaeaea";
 var strAfterFormat = str.replace(/e/g,'b')
 alert(strAfterFormat);
</script>


איפה ה SPAN נכנס כאן?

בקשר ל 2 - הלולאה אמורה לומר: "כל עוד יש משהו ב search_with, היא תתבצע.."


כל הזמנים הם GMT +2. הזמן כעת הוא 07:35.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ