Tag : javascript

11 JavaScript Code Snippets for Dynamic Web Projects

1. Open a Popup Window [php] window.open("http://webdesignledger.com","newWindow"); [/php] 2. Detect When Browser is Closed [php] function getUrlParam(name) { var results = new RegExp(‘[\?&]’ + name + ‘=([^&#]*)’).exec(window.location.href); return (results && results[1]) || undefined; } [/php] 3. Obtain Select Input Value [php] function getUrlParam(name) { var results = new RegExp(‘[\?&]’ + name + ‘=([^&#]*)’).exec(window.location.href); return (results && results[1]) || undefined; } [/php] 4. Browser Detection [php] function getUrlParam(name) { var results = new RegExp(‘[\?&]’ + name + ‘=([^&#]*)’).exec(window.location.href); return (results && […]