Professional Documents
Culture Documents
http://www.functionx.com/javascript/Lesson08.htm
To create a new window object, which corresponds to opening a new instance of the browser, you
can call the window.open() method. Its syntax is:
NewWindow = window.open([WebPage], [WndName], [Options], [Replace])
If you plan to refer to the newly created window in another section of your code, you should give it
a name when creating it. To do this, pass a second argument as string. Here is an example:
<input
type="button"
name="btnNewWindow"
value="Open FunctionX JavaScript in a New Window"
onClick="window.open('http://www.functionx.com/javascript', 'wndNew');"
>
Instead of a formal name, you can specify some options about the existing window (that creates the
new window) and the new window. For example, if you want the new window to be empty, you can
pass the second argument as _blank:
<input
type="button"
name="btnNewWindow"
value="Open FunctionX JavaScript in a New Window"
onClick="window.open('http://www.functionx.com/javascript', '_blank');"
>
If you only want to replace the contents of the current window with the content of the first
argument, you can pass the second argument as _self:
<input
type="button"
name="btnNewWindow"
value="Open FunctionX JavaScript in a New Window"
onClick="window.open('http://www.functionx.com/javascript', '_self');"
JavaScript RegExpressions
http://www.regular-expressions.info/reference.html
Any character
except [\^$.|?*+()
a matches a
\ (backslash) followed
by any of [\^$.|?*+()
{}
\+ matches +
\Q...\E
hexadecimal digits
\n, \r and \t
Match an LF character, CR
character and a tab character
respectively. Can be used in
character classes.
page.
Character
[ (opening square
Description
Example
bracket)
Any character
except ^-]\ add that
character to the
possible matches for
the character class.
[abc] matches a , b or c
\ (backslash) followed
by any of ^-]\
[\^\]] matches ^ or ]
- (hyphen) except
^ (caret) immediately
after the opening [
\d, \w and \s
c or d)
\D, \W and \S
[\b]
Dot
Character
. (dot)
Description
Example
Anchors
Character
Description
Example
^ (caret)
$ (dollar)
\A
\Z
\z
Word Boundaries
Character
\b
Description
Example
\B
(i.e. \W\W ).
Alternation
Character
Description
Example
| (pipe)
| (pipe)
Quantifiers
Character
Description
Example
? (question mark)
??
* (star)
*? (lazy star)
+ (plus)
+? (lazy plus)
{n} where n is an
integer >= 1
"ghi" jkl