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 3606932
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:18:43+00:00 2026-05-18T21:18:43+00:00

In two different views I have the following two pieces of code. FIRST <table

  • 0

In two different views I have the following two pieces of code.

FIRST

<table class="table-list">
   <tr class="gridrow">
      <td>David Gilmour</td>
      <td style="width:16px">
         <a href="#" rel="/xyz/Contact/Edit/26965" class="editContactLink" title="Modifica">
            <img alt="" src="/xyz/_assets/images/edit.png">
         </a>
      </td>
   </tr>
   <tr class="gridrow">
      <td>Paco De Lucia</td>
      <td style="width:16px">
         <a href="#" rel="/xyz/Contact/Edit/26966" class="editContactLink" title="Modifica">
            <img alt="" src="/xyz/_assets/images/edit.png">
         </a>
      </td>
   </tr>
</table>

SECOND

<div>
    <a href="#" rel="/xyz/Contact/Edit/26965" class="editContactLink" title="Modifica">David Gilmour</a>
</div>
<div>
    <a href="#" rel="/xyz/Contact/Edit/26966" class="editContactLink" title="Modifica">Paco De Lucia</a>
</div>

In both cases I use the following jQuery snippet

$("a.editContactLink").click(function (event) {
    event.preventDefault();
    //use $(this).attr("rel") to go to the edit page of the related contact element
});

In the first case I have only one ajax call to the server while in the second I have two ajax calls both going to the same address

Where am I wrong?

  • 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-18T21:18:43+00:00Added an answer on May 18, 2026 at 9:18 pm

    Make sure that your code here:

    $("a.editContactLink").click(function (event) {
        event.preventDefault();
        //...
    });
    

    isn’t running twice, whether by being inside another event, or included twice to begin with, etc. For example if it’s loaded by AJAX, change $("a.editContactLink") to $("a.editContactLink", data) (data being the response), or use a .live() or .delegate() handler, for example:

    $("#container").delegate("a.editContactLink", "click", function(event) {
        event.preventDefault();
        //...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've tried two different methods of reusing code. I have a solution full of
I have two different ways of displaying items in a WPF application. The first
I have the following module, which affects how users arrive at two different content
I'm currently re-using a partial on two different views. View A View B The
Ruby has two different exceptions mechanisms: Throw/Catch and Raise/Rescue. Why do we have two?
I have two different grid controls on the same form. They share the same
I have been given two different Microsoft Word document that my virus scanner has
Let's say I have the 3 different forms defined in my view: # views.py
I'm using two different libraries in my project, and both of them supply a
Here are two different questions but I think they are related. When using Git,

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.