• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

anchor tag , click and livequery

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks ,

I have an anchor which looks like this



im trying to do something when one clicks on this anchor tag


But when i click on the anchor tag . i dont get an alert coz the control isnt going inside that livequery function

this is annoying . what am i doing wrong

 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
coz is not a word UseRealWords

Your selector is saying look for an element with the tag "trigger" and find any element inside that that is the tag "a"

Your selector should just be #trigger

Eric
 
Naveen puttu
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eric ,

#trigger doesnt work for me

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ItDoesntWorkIsUseless

There is no reason it should not work if you are accurately showing your markup.

What version of jQuery are you using?
 
Naveen puttu
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1.2.6 is the jquery version
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have a unique element with an id value, that value will get selected by $('#elementId'). Are you sure that your markup is valid? That the script is being executed?
 
Naveen puttu
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i dont know what exactly do you mean by

Are you sure that your markup is valid? That the script is being executed?

 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your HTML valid? If you have bad HTML, multiple ids of the same value, or other markup errors, nothing will work right.

Also, if the script doesn't execute, it can't do anything.
 
Naveen puttu
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bear,

Im positive that the anchor tag has a unique id

lemme explain what iam trying to achieve

I have a table with th and td tags

i have an anchor tag against one of these th tags . i want to do something when the link is clicked .

By the way what would stop the script from being executed

 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Naveen puttu wrote:Im positive that the anchor tag has a unique id


Then there is no reason that the selector will not work.

i have an anchor tag against one of these th tags . i want to do something when the link is clicked .


Why are you using livequery for this?

By the way what would stop the script from being executed


Bad markup. Other script errors. Etc...

Are you using Firebug to help debug this?
 
Naveen puttu
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
im using firebug for debugging with breakpoint

firstly , no errors reported by firebug when the page loads
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic