|
|
| Baumeister Mediasoft Engineering |
|
|
|
JavaScript (ECMAScript)This section provides JavaScript resources which you will hopefully find useful. Over time, we hope to turn this section into a comprehensive reference for both beginners and experts. We are trying to provide working solutions for professional applications. The scripts and code snippets in this section are taken from real projects. Links to external websites are hand-picked and we only recommend literature which we frequently use ourselves.
Last Change
The JavaScript print() function can be used to print the currently loaded web document, exactly as if the user had activated the browser's function:
The print() function can be used to provide a link:
Working example: Print this Page
The AddFavorite() JavaScript function can be used in Internet Explorer (version 4 or higher) to add a web address (with a title) to the Internet Explorer favorites. AddFavorite() activates the function from the Internet Explorer menu with the given parameters. The following AddFavorite() call can be used to add the BME website address with its title to the Internet Explorer favorites:
The following AddFavorite() call can be used to add the currently loaded page to the Internet Explorer favorites:
A web browser compatibility check such as
is recommended since AddFavorite() is only available in Internet Explorer (version 4 or higher). onclick() can be used to provide a clickable link to the AddFavorite() function call. The following JavaScript code displays a link for adding the currently loaded page to the Internet Explorer favorites:
The setHomePage() JavaScript function uses a DHTML behavior in Internet Explorer (version 5 or higher) to set the user's Homepage. setHomePage() can be applied to objects with the following style attribute:
setHomePage() expects a web address as argument. The following setHomePage() call uses the BME website address:
The following JavaScript statements can be used to set the Homepage address to the URL of the currently loaded web page:
A web browser compatibility check such as
is recommended since setHomePage() is only available in Internet Explorer (version 5 or higher). onclick() can be used to provide a clickable link to the setHomePage() function call. The following JavaScript code displays a link for setting the Homepage address to the URL of the currently loaded web page. The required
For security reasons, setHomePage() causes Internet Explorer to activate a confirmation dialog for changing the Homepage setting.
It's quite simple to display an Email link for sending a page or a link to someone else:
The
The following JavaScript code takes this a bit further:
In the code above, the
Working examples: Send BME Website Link to a Friend
Web-safe color codes include the following RGB values:
The following JavaScript generates a table for displaying the websafe colors:
Output/Display
The following JavaScript statement loads the MIDI file
This statement can easily be used in a hypertext link:
The following example provides a form with a button for activating the same statement through onclick():
Working example: Thanks to Suzanne Rhatigan for preparing this little tune.
The AddFavorite() JavaScript function can be used in Internet Explorer (version 4 or higher) to add a web address (with a title) to the Internet Explorer favorites. AddFavorite() activates the function from the Internet Explorer menu with the given parameters. The following AddFavorite() call can be used to add the BME website address with its title to the Internet Explorer favorites:
The following AddFavorite() call can be used to add the currently loaded page to the Internet Explorer favorites:
A web browser compatibility check such as
is recommended since AddFavorite() is only available in Internet Explorer (version 4 or higher). onclick() can be used to provide a clickable link to the AddFavorite() function call. The following JavaScript code displays a link for adding the currently loaded page to the Internet Explorer favorites:
The JavaScript print() function can be used to print the currently loaded web document, exactly as if the user had activated the browser's function:
The print() function can be used to provide a link:
Working example: Print this Page
The setHomePage() JavaScript function uses a DHTML behavior in Internet Explorer (version 5 or higher) to set the user's Homepage. setHomePage() can be applied to objects with the following style attribute:
setHomePage() expects a web address as argument. The following setHomePage() call uses the BME website address:
The following JavaScript statements can be used to set the Homepage address to the URL of the currently loaded web page:
A web browser compatibility check such as
is recommended since setHomePage() is only available in Internet Explorer (version 5 or higher). onclick() can be used to provide a clickable link to the setHomePage() function call. The following JavaScript code displays a link for setting the Homepage address to the URL of the currently loaded web page. The required
For security reasons, setHomePage() causes Internet Explorer to activate a confirmation dialog for changing the Homepage setting.
The literature listed in this section is hand-picked. We only recommend books which we frequently use ourselves. You can use the Amazon links provided for online ordering if you are interested in purchasing any of the books. Simply chose the link to the Amazon website closest to you. Amazon.co.uk is located in the United Kingdom, Amazon.com is located in the United States, and Amazon.de is located in Germany. Recommended reading on JavaScript (ECMAScript):
JavaScript (ECMAScript) • © 2017 Manfred Baumeister • Updated: 01 October 2011, 13:27 [UTC] |
| Baumeister Mediasoft Engineering, Clontarf, Dublin 3, Ireland © 2017 Manfred Baumeister |
|