473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to detect Link in a Tab is activated or clicked

77
i want to detect Link in a Tab is activated or clicked from my code. here the situation


I have tabs that have link to web pages like example below :

Expand|Select|Wrap|Line Numbers
  1. <ul id="tabs">
  2. <li><a href="http://www.asdf.com"/><span>asdf</span></a></li>
  3. <li><a href="http://www.dddd.com"><span>dddd</span></a></li>
  4.  
And to detect that link is activated, i make this code below :
Expand|Select|Wrap|Line Numbers
  1. <script type='text/javascript'>
  2. $('a').click(function(){
  3.     alert('activated');
  4. });
  5. </script>
  6.  

but it's show an error : $ is not defined

any idea??

thanks, regards : maminx
Aug 28 '09 #1
1 2526
RamananKalirajan
608 512MB
Hi Maminx,
This error is due to that you have used '$' which is a element in prototyope framework. It gives the object reference. Wether have you included the prototype framework in your code? Eventhough there is no id --> 'a' in your html code. $ is just a replacement for document.getElementById();

Thanks and Regards
Ramanan Kalirajan
Aug 28 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mat | last post by:
How can I detect when a link has been clicked but the new page is still in the process of loading? The document.location.href property still displays the current location (understandably) not the...
4
by: crhaynes | last post by:
I'm having trouble with my CSS. My links are black, my hover is orange and my active link is red. When I select a link it turns red but i does not retain that color when the selected page loads. ...
5
by: Quinn | last post by:
When users clicked a unkown mime type link such as Zip on my website, a "Save/Open/Cancel" dialog box pops up. Is there a way to detect which button users clicked by using ASP? actually I only what...
1
by: sihnstarr | last post by:
I have a pop-up window that contains a chart with a list of links. When the link is clicked, it is supposed to close the pop-up window and navigate to the page selected from the pop-up in the...
7
by: who be dat? | last post by:
I need some help here. I'm creating a list on a page where the list is created from a dataset with two tables linked with a datarelation. The first table is a list of groups while the second...
1
by: Ben Amada | last post by:
Hi, I'm using the built-in calendar control. One problem I'm having is that if the user clicks on the day in the calendar which is already the SelectedDate, a postback occurs, but the...
8
by: thomasamillergoogle | last post by:
I am trying to detect what asp.net button was clicked duing the page_load event. I have two asp.net buttons on my page. What is the easiest way to detect this?
9
by: newcomsas | last post by:
Hello. I'm working on a problem related with CSS and javascript: I have got a link on a page and a stylesheet file that makes the background color change when users click on it. Is there...
6
by: Spartanicus | last post by:
I'd like to execute a function when a <link rel="next" href="foo.htm"> type element is used. Although the "onclick" handler is allowed on the element, presumably because the functionality of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.