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

  • Home
  • SEARCH
  • 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 6118875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:29:13+00:00 2026-05-23T15:29:13+00:00

<script> $(function(){ $(‘.logger’).bind(‘click’,function(){ alert(‘we will log that the user shared something’); return true; //keep

  • 0
<script>
$(function(){
    $('.logger').bind('click',function(){
        alert('we will log that the user shared something');
        return true; //keep going, pretend nothing happened.
    });

    $('.share').bind('click',function(){
        window.open('blah');
        return false; 
    });
});
</script>
<a href="#" class="share logger">Share this</a>

I want to be able to trigger BOTH the logger and the share functions. But right now, only the share function is triggered. If I comment share function, then the logger function works fine.

I’ve also tried to change the “class” so that logger is before share.

  • 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-05-23T15:29:14+00:00Added an answer on May 23, 2026 at 3:29 pm

    When you return false; in an event handler that stops the event propagation, that is why the other handler is not triggered. If you just want to stop the default action, use event.preventDefault().

    This article does a good job explaining the concept:

    First off, return false is actually
    doing three very separate things when
    you call it:

    1. event.preventDefault();
    2. event.stopPropagation();
    3. Stops callback execution and returns
      immediately when called.

    “Wait a
    minute,” you cry! I only needed to
    stop the default behavior! I don’t
    need these other two items
    … I think.

    The only one of those three actions
    needed to cancel the default behavior
    is preventDefault(). Unless you mean
    to actually stop event propagation
    (bubbling), using return false will
    greatly increase the brittleness of
    your code

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

Sidebar

Related Questions

I need a java script function that converts the document object of the current
I have a java script function that i have called on body load mousemove()
For example: script.js: function functionFromScriptJS() { alert('inside functionFromScriptJS'); } iframe.html: <html> <head> <script language=Javascript
I need a simple proxy PHP function/script that can download a file from a
Have next script: function clicker(){ var linkId = [id*= + link]; var butnId='initial'; $j(linkId).click(function(){
How do I call a client script function from a server side button click(with
I have a java Script function that i want to call whenever mouse moves
Hi I have this script: function ajax(){ if (navigator.standalone) return; for (var i= document.links.length;
Here's the script: function runScripts() { if (arguments.length === 0) return; chrome.tabs.executeScript(null, { file:
I am calling two function one Java script and one Jquery function on click

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.