WebRef.eu  - Internet Marketing and Online Business Resources  

Home / Site Map | Blog | TwitterTwitter | Contact


Javascript Notes

Notes on how to code with Javascript.

How to Add A Javascript Script to Your Page

Javascript is put into script tags, and can be put in the head section of your html page. Below is a simple example that will display an alert when the page is loaded. Note we have not used a function, so it does not need to be called and will run by default when the page is loaded.

Here's the full web page code:

<!doctype html>

<meta charset="utf-8">
<title>Javascript Simple Alert Example</title>
<script language="javascript">
alert("Hi there, welcome to this page.")


<p>Javascript simple alert example page.</p>



See working example.

Javascript Back

<a href='javascript:history.go(-1)'>back</a>

Javascript Refresh Page

<input type="button" value="Refresh Page" onClick="window.location.reload()">


<a onClick="window.location.reload()">Refresh</a>

Javascript Status Bar Masking

<a href="http://www.youraffiliate link" onMouseOver="window.status='your text here!'; return true" onMouseOut="window.status=''; return true">Click here</a>

Bookmark This Page Script

I found this example script at:


However, I found it to only provide an Add to Bookmarks pop-up in Firefox, so it does not add that much value to the user. Here's the working example.





Low Prices UK Shopping

Compare Prices
at LowPrices.co.uk

Home / Site Map | TwitterTwitter | Contact

All Content ©2018 WebRef.eu