permaculture playing cards*
The moose likes HTML, CSS and JavaScript and the fly likes Confusing jquery code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Confusing jquery code" Watch "Confusing jquery code" New topic
Author

Confusing jquery code

David Mbura
Ranch Hand

Joined: Apr 06, 2010
Posts: 65
For some reason when i click book list element it shows both forms(books and classes) instead of just book form as if there is no break statement,i am really confused why is it doing that?
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4240
    
    7

I just tried it out, and it seemed to work correctly (with including JQuery the only addition to the file). Are you sure that the code you posted is the code you're running?

From a stylistic point of view, I think it would be much better to add separate event handlers to the two elements, rather than adding the same event handler to each and then having to switch on the ID.
David Mbura
Ranch Hand

Joined: Apr 06, 2010
Posts: 65
Thank you for the advice.And actually the code i was running is a little different,but i figured that couldn't be the cause ,I will go over it again and see what i get...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Always be sure to post a self-contained code example that you know shows the issue.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Confusing jquery code
 
Similar Threads
jQuery not "seen" [ghost buster]
Need help on understanding ww:token
set values in a table from other
JSP <a href> tags breaks page functionality
Tomcat auth-method = form with 3 login fields.