Posts Tagged ‘javascript’

When you call showModalDialog() you need to pass “self”, without the quotes, as the second argument. You can then access the parent(opener) with: var opener = window.dialogArguments; You can then access any function declared in parent window with: opener.myFunction();

Aug 15th, 2008 | Filed under general web, javascript

/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/ All regular expressions start and end with forward slashes to differentiate them from ordinary string expressions. Most regular expressions start matches at the first character ^ and end at the last $. Now we try to match the mailbox name which can include periods and dashes \w+ states one or more alphanumeric must be […]

Aug 2nd, 2007 | Filed under java, javascript

var a = “151 “; a = a.replace(/^\s+|\s+$/, “”); //a is now “151” . Note: \s : Matches a single white space character, including space, tab, form feed, line feed. Equivalent to [ \f\n\r\t\v\u00A0\u2028\u2029]. \S: Matches a single character other than white space. Equivalent to [^ \f\n\r\t\v\u00A0\u2028\u2029].

Aug 2nd, 2007 | Filed under javascript