Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 4th, 2003, 12:43 AM
Authorized User
 
Join Date: Jun 2003
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tgopal
Default Hyperlink

How can we invoke an hyperlink through programatically.
((i.e) getting the same effect as click the hyperlink.)
 
Old July 4th, 2003, 02:06 AM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

One (IE only) way of doing it is:

<a id="myLink" href="http://p2p.wrox.com">A link</a>

document.getElementById("myLink").click();


/Robert
 
Old July 4th, 2003, 10:21 AM
Authorized User
 
Join Date: Jun 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to natmaster Send a message via AIM to natmaster Send a message via MSN to natmaster
Default

you could also:
<script language="Javascript">
//<!--
function dofunc(obj) {
var obj=document.getElementById(which);
//then do your stuff with obj
}
//--!>
</script>

<a id="myLink" onClick="dofunc(this);" href="http://p2p.wrox.com">A link</a>

----------------------------
http://aeonofdarkness.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink sryap3 Access VBA 1 November 20th, 2008 04:25 PM
How we can use hyperlink nagham Crystal Reports 0 February 9th, 2007 03:51 AM
hyperlink kritimehrotra Excel VBA 3 July 24th, 2006 08:32 PM
hyperlink hyperlink sbhandar Classic ASP Basics 6 August 26th, 2004 02:04 AM
hyperlink pab006 Classic ASP Basics 5 December 17th, 2003 10:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.