954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

HTML Link without clicking

How can I link to another URL when my web page opens without clicking on "link"?
I'm just learning html and understand how to link using the anchor and href.
Example:

<html>
<body>

<p>
<a href="http://msm/com">
Click Here </a> 
</p>

</body>
</html>


How can I get my webpage to open the link without having to have the "Click Here" present?

RFBourquin
Newbie Poster
8 posts since Apr 2006
Reputation Points: 10
Solved Threads: 0
 

You can either use a refresh meta-tag or you can set window.location in javascript.

Here is the javascript solution:

<html>
<head>
   <script type="text/javascript">window.location="http://msm.com";</script>
</head>
</html>


Here is the REFRESH solution:

<html>
<head> 
  <META http-equiv="refresh" content="1;URL=http://msm.com">
</head>
<body>
    REDIRECTING YOU.... 
</body>
</html>
blater
Light Poster
25 posts since Mar 2008
Reputation Points: 12
Solved Threads: 7
 

Thanks very much. Both solutions work great.

RFBourquin
Newbie Poster
8 posts since Apr 2006
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You