473,807 Members | 2,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Make text behave like hyperlink

Hi, I have an "A" object without an href
<a onClick="openwi ndow()">some text<a>
Is there any way to make it behave like a hyperlink? i.e. to have a
hand when the cursor hoovers above it?
Thanks

Mar 10 '07 #1
4 4877
2g*****@gmail.c om said the following on 3/10/2007 2:35 PM:
Hi, I have an "A" object without an href
<a onClick="openwi ndow()">some text<a>
Is there any way to make it behave like a hyperlink? i.e. to have a
hand when the cursor hoovers above it?
Yes, make it a hyperlink...

<a href="nowhere.h tml" onclick="openwi ndow();return false">some text</a>

Or, style the A element with CSS.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 10 '07 #2
While the city slept, Randy Webb (Hi************ @aol.com) feverishly
typed...
2g*****@gmail.c om said the following on 3/10/2007 2:35 PM:
>Hi, I have an "A" object without an href
<a onClick="openwi ndow()">some text<a>
Is there any way to make it behave like a hyperlink? i.e. to have a
hand when the cursor hoovers above it?

Yes, make it a hyperlink...

<a href="nowhere.h tml" onclick="openwi ndow();return false">some
text</a>
Or even better, have the link open the file that openwindow() opens, so that
the page is still available to users without javascript...

Cheers,
Nige

--
Nigel Moss http://www.nigenet.org.uk
Mail address will bounce. ni***@DOG.nigen et.org.uk | Take the DOG. out!
"Your mother ate my dog!", "Not all of him!"
Mar 10 '07 #3

"nice.guy.n ige" <ni********@dea dspam.comwrote in message
news:45******** *************** @authen.yellow. readfreenews.ne t...
While the city slept, Randy Webb (Hi************ @aol.com) feverishly
typed...
>2g*****@gmail.c om said the following on 3/10/2007 2:35 PM:
>>Hi, I have an "A" object without an href
<a onClick="openwi ndow()">some text<a>
Is there any way to make it behave like a hyperlink? i.e. to have a
hand when the cursor hoovers above it?

Yes, make it a hyperlink...

<a href="nowhere.h tml" onclick="openwi ndow();return false">some
text</a>

Or even better, have the link open the file that openwindow() opens, so
that
the page is still available to users without javascript...

Cheers,
Nige

--
Nigel Moss http://www.nigenet.org.uk
Mail address will bounce. ni***@DOG.nigen et.org.uk | Take the DOG. out!
"Your mother ate my dog!", "Not all of him!"

Hi,

How about...

<a href="javascrip t: openwindow();re turn false">some text</a>

Hope this helps

Andy
Mar 11 '07 #4
Andrew Bailey said the following on 3/11/2007 7:04 AM:

<snip>
Hi,

How about...
No.
<a href="javascrip t: openwindow();re turn false">some text</a>
<a href="thePageTo OpenIfScriptIsD isbaled.html"
onclick="openwi ndow(this.href) ;return false">
The link Text</a>
Hope this helps
<URL: http://jibbering.com/faq/index.html#FAQ4 _24>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 11 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
10989
by: Mike Mella | last post by:
I built a simple form where a user can enter and post news items to his site (with PHP, into MySQL). He doesn't know much HTML. Is there some way he can enter some simple text to declare something a hyperlink, and have PHP recognize that that means "make this text into a hyperlink"? ....so that instead of having to type this into the textarea: <a href="http://www.somesite.com">somesite</a>
0
2035
by: Nel | last post by:
I am trying to write a content management section for a web site. I have managed so far to use htmlarea to give users a basic, but user friendly interface by which to edit the page content. The user can add emails by symply typing john@example.com - IE automatically converts this to a hyperlink. The trouble is sometimes the users use plain text. I have been using the following line to convert plain text to a hyperlink:
6
1526
by: Tina | last post by:
I'm going through a DataGridItem looking to find the text in a hyperlink column. It's not in mydataGridItem.cells(3).text. Where is it? thanks, T
6
1921
by: GaryB | last post by:
Does anyone have any idea how to get the text out of a hyperlink column in a web datagrid? It's a hyperlink column, not a template column so findcontrol does not work and there is no apparent name to look for. myGridItem.cells(0).controls(0) shows no text properties or anything that points to or contains the text. It seems quite hidden.
3
1239
by: Terry Olsen | last post by:
I have a datagrid filled with shipping records. I would like to make the field that contains the tracking numbers to be links where the user can click and automatically track that particular shipment. Is this possible? How would I go about it? Thanks.
19
3562
by: Joe | last post by:
I have an aspx page (referred to here as page_1) with a datagrid whose first column contains hyperlinks. When a user clicks one of these hyperlinks, he will navigate to another aspx page (referred to here as page_2). I need to cache the value of the link's text (hyperlink.text property) so that I can use it in the page_load event of page_2. I've thought of using a hidden field and then calling Request.Form("hdnClickedLinkText") in the...
1
2651
by: jeguillo | last post by:
I am trying to retrieve the text within each cell in a datagrid in order to change the color of each cell, depending on the value within that cell. This works fine on the cells that are bound columns, but returns an empty string for the cells that are hyperlink columns. Here is the code to retrive the text: Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
3
3738
by: avanti | last post by:
HI, I have a HyperLink in my code. It has a OnClick function defined. I am trying to access the text property of the HyperLink in my JavaScript function. <CoreCtrl:Controls.WebControls.HyperLink id="securityCodeLink" text="My Text" OnClick="ShowText(this);" Href="#" CssClass="textSmall" runat="server" />
4
4123
by: alun65 | last post by:
I'm attempting to programmatically build up some HTML in the code behind. Like so: // Create Hyperlink HyperLink link = new HyperLink(); link.NavigateUrl = "nice cat"; link.Text = "Cats Sleeping"; //Create Image Image img = new Image();
0
9720
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10112
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.