User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 374,193 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,542 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 510 | Replies: 2 | Solved
Reply
Join Date: Apr 2006
Posts: 7
Reputation: RFBourquin is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
RFBourquin RFBourquin is offline Offline
Newbie Poster

HTML Link without clicking

  #1  
May 11th, 2008
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:

  1. <html>
  2. <body>
  3.  
  4. <p>
  5. <a href="http://msm/com">
  6. Click Here </a>
  7. </p>
  8.  
  9. </body>
  10. </html>

How can I get my webpage to open the link without having to have the "Click Here" present?
Last edited by peter_budo : May 11th, 2008 at 12:46 pm. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2008
Posts: 25
Reputation: blater is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 7
blater's Avatar
blater blater is offline Offline
Light Poster

Re: HTML Link without clicking

  #2  
May 11th, 2008
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>
Reply With Quote  
Join Date: Apr 2006
Posts: 7
Reputation: RFBourquin is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
RFBourquin RFBourquin is offline Offline
Newbie Poster

Re: HTML Link without clicking

  #3  
May 13th, 2008
Thanks very much. Both solutions work great.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 5:00 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC