Normally, the split() and join() methods are used to combine arrays into
strings, to be stored in cookies. But they can also be used for a find and
replace script, such as this one.
The split() method takes a peice of text and/or HTML, and makes each peice of
text before and after each occurance of the text into an array item.
Example: var text = "Congress shall make no law respecting an establishment of
religion"; text = text.split("a") This would equal: var text = new Array();
text[0]="Congress shall make no l"; text[1]="w respecting "; text[2]="n est";
text[3]="blishment of religion"; all of the "a"s have been removed
The join() method does the opposite, it recontructs the array into a string
Example: text = text.join("a") This would equal: var text = "Congress shall make
no law respecting an establishment of religion"; However, you can use a
different character for join() Example: text = text.join("117") This would
equal: var text = "Congress shall make no l117w respecting 117n est117blishment
of religion";
That's how this script works. Try it using the form below.
Congress shall make no law respecting an establishment of religion, or
prohibiting the free exercise thereof; or abridging the freedom of speech, or of
the press; or the right of the people peaceably to assemble, and to petition the
government for a redress of grievances.
A well regulated militia, being necessary to the security of a free state,
the right of the people to keep and bear arms, shall not be infringed.
No soldier shall, in time of peace, be quartered in any house, without the
consent of the owner, nor in time of war, but in in a manner to be prescribed by
law.
The right of the people to be secure in their persons, houses, papers, and
effects, against unreasonable searches and seizures shall not be violated, and
no warrants shall issue, but upon probable cause, supported by oath or
affirmation, and particularly describing the place to be searched, and the
persons or things to be seized.
No person shall be held to answer for a capital, or otherwise infamous crime,
unless on a presentment or indictment of a grand jury, except in cases arising
in the land or naval forces, or in the militia, when in actual service in time
of war or public danger; nor shall any person be subject for the same offense to
be twice put in jeopardy of life or limb; nor shall be compelled in any criminal
case to be a witness against himself, nor be deprived of life, liberty, or
property, without due process of law; nor shall private property be taken for
public use, without just compensation.
In all criminal prosecutions the accused shall enjoy the right to a speedy
and public trial, by an impartial jury of the state and district wherein the
crime shall have been committed, which district shall have been previously
ascertained by law, and to be informed of the nature and cause of the
accusation; to be confronted with the witnesses against him; to have compulsory
process for obtaining witnesses in his favor, and to have the assistance of
counsel for his defense.
In suits at common law, where the value in controversy shall exceed twenty
dollars, the right of trial by jury shall be preserved, and no fact tried by a
jury shall be otherwise re-examined in any court of the United States, than
according to the rules of the common law.
Excessive bail shall not be required, nor excessive fines imposed, nor cruel
and unusual punishments inflicted.
The enumeration in the Constitution, of certain rights, shall not be
construed to deny or disparage others retained by the people.
The powers not delegated to the United States by the Constitution, nor
prohibited by it to the states, are reserved to the states respectively, or the
the people.