Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8711775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:58:00+00:00 2026-06-13T04:58:00+00:00

Possible Duplicate: Prevent execution of parent event handler I’m using a nice plug-in (

  • 0

Possible Duplicate:
Prevent execution of parent event handler

I’m using a nice plug-in (jQuery drop-down) to add a drop down to a table row:

An attribute is placed on a trigger object that contains the ID of a menu to display. In this case “data-dropdown” on a table row.

<tr data-dropdown="#dropdown-first">
  <td><a href="http://www.boston.com">Basic</a></td>
  <td>The basic plan</td>
</tr>

My issue is one of the TDs contains a link but the link will always trigger the drop down rather than launch a new page. This is a snippet of the plug-in code that calls the menu:

$(function () {
    $('BODY').on('click.dropdown', '[data-dropdown]', showMenu);
    $('HTML').on('click.dropdown', hideDropdowns);
});

Is there a way to modify the selector in the .on event to exclude a specific child tag such as my link ?
Is there another suggested strategy? I’d like to keep the plug-in intact as possible so its highly re-usable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:58:02+00:00Added an answer on June 13, 2026 at 4:58 am

    The problem is you are putting the data-dropdown attribute on the row. Clicking on anything within that row will trigger the event, and the logic inside showMenu does not even check if it shouldn’t proceed once anything has been clicked.

    Does the entire row have to cause the dropdown? If not, place the data-dropdown on something within the row.

    Otherwise, modify the jquery.dropdown.js and add this at line 41, before the event.preventDefault() line:

    if (trigger != event.target && $(event.target).hasClass('dropdown-ignore')) return;
    

    Then add the class ‘dropdown-ignore’ to your boston.com link.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Prevent click event from affecting parent jquery I have a DOM structure
Possible Duplicate: Prevent any form of page refresh using jQuery/Javascript how can i prevent
Possible Duplicate: Throttle event calls in jQuery I like the .change() functionality of jQuery,
Possible Duplicate: Will using LINQ to SQL help prevent SQL injection I'm using LINQ
Possible Duplicate: How do I make a request using HTTP basic authentication with PHP
Possible Duplicate: What is the advantage of using try {} catch {} versus if
Possible Duplicate: how to prevent your javascripts being stolen,copied, and viewed ? What is
Possible Duplicate: Best way to prevent SQL injection in PHP? I've made a PHP
Possible Duplicate: Is there a clean way to prevent windows.h from creating a near
Possible Duplicate: Dollar ($) sign in password string treated as variable I am using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.