HOW COME MY SCRIPT DOESNT WORK? |
HOW COME MY SCRIPT DOESNT WORK? |
Feb 18 2007, 11:11 PM
Post
#1
|
|
|
Senior Member ![]() ![]() ![]() Group: Member Posts: 78 Joined: Apr 2006 Member No: 391,072 |
<script type="text/javascript">
function replaceWords() { var oldWords = new Array( "Name:", "Birthday:", "Gender:", "Interests:", "Expertise:", "Email:", "MSN:", "Member Since:", "eprops", "eprop", "comments", "comment", "email it", "Subscriptions", "My Blogrings", "Posting Calendar", "Get Involved!", "Subscribe to D_ollylolita", "read my profile", "sign my guestbook", "Next 5", "Previous 5"); var newWords = new Array( "<img src= http://i4.photobucket.com/albums/y105/ai_a...Iconns/icon.gif border=0>", " ", "<img src= http://i4.photobucket.com/albums/y105/ai_a...Iconns/icon.gif border=0>", " ", "<img src= http://i4.photobucket.com/albums/y105/ai_a...onns/ichigo.gif border=0>", "<img src= http://i4.photobucket.com/albums/y105/ai_a..._Iconns/389.gif border=0>[朋友仔)ADD我就同我UP聲先<img src= http://i4.photobucket.com/albums/y105/ai_a..._Iconns/389.gif border=0>", "◤如上na◢ <img src= http://i4.photobucket.com/albums/y105/ai_a...Iconns/icon.gif border=0>", "<img src= http://i4.photobucket.com/albums/y105/ai_a...nns/eicon21.gif border=0> 玫瑰種植日期:", "<marquee behavior=alternate width=37><img src= http://i4.photobucket.com/albums/y105/ai_a...conns/bara3.gif border=0></marquee> ROZE ", " *我的薔薇 <marquee behavior=alternate width=37><img src= http://i4.photobucket.com/albums/y105/ai_a...conns/bara7.gif border=0></marquee>", " 我的薔薇* <marquee behavior=alternate width=37><img src= http://i4.photobucket.com/albums/y105/ai_a...conns/bara3.gif border=0></marquee>", " ROZE <marquee behavior=alternate width=37><img src= http://i4.photobucket.com/albums/y105/ai_a...conns/bara7.gif border=0></marquee>", "<img src= http://i4.photobucket.com/albums/y105/ai_a...i_Iconns/30.gif border=0>", "<img src= http://i4.photobucket.com/albums/y105/ai_a...nns/01d_005.gif border=0>", "<img src= http://i4.photobucket.com/albums/y105/ai_a...P3993840N26.gif border=0> <img src= http://i4.photobucket.com/albums/y105/ai_a...P3993840N26.gif border=0>£«<img src= http://i4.photobucket.com/albums/y105/ai_a...P3993840N26.gif border=0> ", "<marquee behavior=alternate width=55><img src=http://i4.photobucket.com/albums/y105/ai_aangle/Minii_Iconns/04-09.gif border=0></marquee><marquee behavior=alternate width=55><img src= http://i4.photobucket.com/albums/y105/ai_a...conns/04-09.gif border=0></marquee>", "<img src= http://i4.photobucket.com/albums/y105/ai_a...Iconns/icon.gif border=0>", "<img src= http://i4.photobucket.com/albums/y105/ai_aangle/i16-01.gif border=0>", "<img src= http://i4.photobucket.com/albums/y105/ai_a...Iconns/icon.gif border=0>", "<img src= http://i4.photobucket.com/albums/y105/ai_a...Iconns/icon.gif border=0>", "<marquee behavior=alternate width=37><img src= http://i4.photobucket.com/albums/y105/ai_a..._Iconns/754.gif border=0></marquee> ", "<marquee behavior=alternate width=37><img src= http://i4.photobucket.com/albums/y105/ai_a..._Iconns/753.gif border=0></marquee>"); allTableData = document.getElementsByTagName('td'); allTableHeaders = document.getElementsByTagName('th'); var collections = new Array(allTableData,allTableHeaders); for (var k = 0 ; k < collections.length ; ++k ) { for (var i = 0 ; i < collections[k].length ; ++i ) { if (collections[k][i].innerHTML.indexOf('TABLE') == -1) { for ( var n = 0 ; n < oldWords.length; ++n ) { var indx = collections[k][i].innerHTML.indexOf(oldWords[n]) while (indx != -1) { var replacement = ''; indx = collections[k][i].innerHTML.indexOf(oldWords[n]); replacement = collections[k][i].innerHTML.replace(oldWords[n], newWords[n]); if(navigator.userAgent.toLowerCase().indexOf('compatible')>0){collections[k] [i].innerHTML=replacement;//please use supported code at http://help.xanga.com/codes.htm } break; } } } } } } replaceWords(); </script> |
|
|
|
![]() |
Feb 25 2007, 11:55 AM
Post
#2
|
|
|
Senior Member ![]() ![]() ![]() ![]() Group: Member Posts: 122 Joined: Feb 2005 Member No: 106,057 |
I'd agree. Usually, when there's an error on one javascript code on a page, all the subsequent scripts just don't run. For all we know, this could be completely fine, but another script on your page is having problems. Seeing that you've got some more serious problems to fix on your page, you probably should get everything else fixed up.
If you still think the problem might be in this code, the most common error I see is a missing or additional quote character. Remember, the computer is stupid and can't tell if your a quote character is part of the thing you want to replace or the end of a string. |
|
|
|
rosedoll HOW COME MY SCRIPT DOESNT WORK? Feb 18 2007, 11:11 PM
Wo0yaPo0ya You can't have the space after the = and befor... Feb 19 2007, 12:18 AM
rosedoll it still didnt work
ill give you my site and see:... Feb 19 2007, 12:39 AM
digital.fragrance To my knowledge, you can't replace a word with... Feb 20 2007, 03:10 PM
rosedoll OH* yes you can! before my xanga were using th... Feb 20 2007, 06:37 PM
digital.fragrance You have so many random symbols in your entire lay... Feb 20 2007, 06:40 PM
Gypsy Eyes QUOTE(digital.fragrance @ Feb 20 2007, 6... Feb 21 2007, 11:57 PM
rosedoll its the same without "and put in ' this o... Feb 21 2007, 11:30 PM
rosedoll but i tried with out using the chinese letters in ... Feb 22 2007, 07:17 PM
digital.fragrance I think you're going to have to start from scr... Feb 23 2007, 07:17 PM![]() ![]() |