Question: How can I have a button on my webpage that shares the link the user is viewing automatically to his or her facebook timeline? 
For eg if he or she is in mypage.com/aboutme then the link will be shared on his or her facebook timeline when clicked...

Answer: 
Call it on page load.

```
window.onload = function(){
   myFunction();
}

```
put the entire stuff in to a function at the end of the doc:

```
<!DOCTYPE html>
<html>
<head>

</head>

<body>
<center>
<div id="quote1"></div>
<br>
<br>
<br>
<br>
<br>
<center>
<a href="#" onclick="randomQuote()">Next</a>
</center>
</center>
</body>

<script>
var randomQuote = function() {
    var quotes = [
       {text:" <br>    1   <br><br>    2   <br><br>    3   ",},
       {text:" <br>    4   <br><br>    5   <br><br>    6   ",},
       {text:" <br>    7   <br><br>    8   <br><br>    9   ",},
     ];
     var quote1 = quotes[Math.floor(Math.random() * quotes.length)];
     document.getElementById("quote1").innerHTML=
          '<p><font size="7">' + quote1.text + '</font></p>';
 };
 randomQuote();

</script>
</html>

```

The last line will execute the function immediately.