Posted By

sondosia on 12/30/06


Tagged

words xanga blogs blogging replacement


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

shachi
vali29


Replace Words


 / Published in: JavaScript
 

URL: http://www.geocities.com/cheerfreak908/FAQ.htm

Replaces certain words in a xanga with others

  1. <script type="text/javascript">
  2. //
  3. // © EasterEgg, http://www.xanga.com/easteregg
  4. //
  5. // For use at Xanga only.
  6. //
  7. // This script replaces any given word or text fragment with
  8. // whatever you want: new words and fragments, or even HTML!
  9. //
  10. // Actually it's pretty simple: add the words or fragments you
  11. // wish to replace to the array "oldWords" (each word placed
  12. // between double quotation marks, and separated by colons as you
  13. // can see below) and add their replacements to the array "newWords",
  14. // at the same position as the original words in "oldWords".
  15. // The example is pretty self-explaining.
  16. //
  17. // The script is case sensitive, meaning that if you add "something"
  18. // to "oldWords" array it will not recognize "SOMETHING", or "SoMetHInG".
  19. //
  20. // You can adjust the existing arrays in this code as you see fit,
  21. // as long as both arrays keep the same size (same amount of words
  22. // in both arrays), otherwise a script error will occur.
  23. //
  24. // Copy this entire code and paste in the webstats box at your
  25. // Look and Feel page.
  26. //
  27. // You're free to use this script as long as this comment remains intact,
  28. // and as long you won't use it to cripple the comments of your visitors;
  29. // after all, no one likes his/her words getting twisted...
  30. //
  31. function replaceWords()
  32. {
  33. // ***add the words or fragments you wish to replace below
  34. var oldWords = new Array(
  35. "Subscriptions",
  36. "Publish Comments",
  37. "add eProps",
  38. "eprop",
  39. "eProps",
  40. "add comments",
  41. "comment",
  42. "comments",
  43. "email it",
  44. "view entire profile",
  45. "sign my guestbook",
  46. "My Blogrings",
  47. "Posting Calendar",
  48. "Get Involved!",
  49. "sign out",
  50. "Name:",
  51. "Birthday:",
  52. "Gender:",
  53. "State:",
  54. "Country:",
  55. "Interests:",
  56. "Expertise:",
  57. "Website",
  58. "Email",
  59. "Member since:");
  60.  
  61. // *** add the replacing words or fragments below
  62. var newWords = new Array(
  63. "Subscriptions",
  64. "Publish Comments",
  65. "add eProps",
  66. "eprop",
  67. "eProps",
  68. "add comments",
  69. "comment",
  70. "comments",
  71. "email it",
  72. "view entire profile",
  73. "sign my guestbook",
  74. "My Blogrings",
  75. "Posting Calendar",
  76. "Get Involved!",
  77. "sign out",
  78. "Name:",
  79. "Birthday:",
  80. "Gender:",
  81. "State:",
  82. "Country:",
  83. "Interests:",
  84. "Expertise:",
  85. "Website",
  86. "Email",
  87. "Member since:");
  88.  
  89. allTableData = document.getElementsByTagName('td');
  90. allTableHeaders = document.getElementsByTagName('th');
  91.  
  92. var collections = new Array(allTableData,allTableHeaders);
  93.  
  94. for (var k = 0; k < collections.length; ++k )
  95. {
  96. for (var i = 0; i < collections[k].length; ++i )
  97. {
  98. if (collections[k][i].innerHTML.indexOf('TABLE') == -1)
  99. {
  100. for ( var n = 0; n < oldWords.length; ++n )
  101. {
  102. var indx = collections[k][i].innerHTML.indexOf(oldWords[n])
  103. while (indx != -1)
  104. {
  105. var replacement = '';
  106. indx = collections[k][i].innerHTML.indexOf(oldWords[n]);
  107. replacement = collections[k][i].innerHTML.replace(oldWords[n], newWords[n]);
  108. collections[k][i].innerHTML = replacement;
  109. break;
  110. }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. replaceWords();
  117. </script>

Report this snippet  

You need to login to post a comment.