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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:36:15+00:00 2026-06-12T09:36:15+00:00

Im having some issues with query and binding as it seems. in my _Layout

  • 0

Im having some issues with query and binding as it seems.

in my _Layout i got the jquery at the bottom of the page, it got a .on('click')

In got a partialView that got a “add item” link, when i click it makes a $.post() that returns a parialview and populates it in a div container.

Next time when i try to add another item with a click on the same link, it just acts like a link and refreshed the site, like it lost the binding to the jquery. If i choose to have the jquery in the partial that renders over it work every time, but for the sake of structure i dont want to have jquery scripts in the middle of the page.

Why is that and what can i do?

EDIT:
this is the bind i got. it works like before just once.

$('.menu-day').on('click', 'a.addItem', function (e) {
          e.preventDefault();
          console.log('ok');
          addRow($(this).attr('id'));
});
  • 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-12T09:36:16+00:00Added an answer on June 12, 2026 at 9:36 am

    Using $().on(‘click’, function() { … }) works a lot like a traditional .click() binding in that the element has to exist on the page before you bind it. For example:

    $("ul li").on('click', function() { ... })
    

    So that isn’t going to work with dynamically added list elements. What you can do is specify a selector inside the click which will listen for events that bubble up to the context. For example:

    $("ul").on('click', 'li', function() { ... });
    

    Now clicks on list items will trigger regardless of when they were added, since it’s the container list that was bound and is simply listening for a specific eventTarget.

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

Sidebar

Related Questions

I am having some issues returning data from on page, using jQuery, PHP and
I am having some issues throwing together a LINQ query that will join a
I am having some issues with multiple form submissions with a jQuery/ajax form. I
I'm having some issues to deserialize a Json array that follows this format: [
I am having some issues with a code that is occasionally and sporadically throwing
Recently I was having some issues with a singelton class that was lazy initializing
I am having some issues with a group query with MySQL. Question Is there
I'm having some issues returning unique results from a table that has some repeating
I am having some issues with the below query, I was unsure as to
I'm having some paging issues when I wan't to display the next page with

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.