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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:03:38+00:00 2026-05-23T16:03:38+00:00

I have a page with a ticket list. In it, there is a <td>

  • 0

I have a page with a ticket list. In it, there is a <td> that is either a grab or release link. That link inside the ” is wrapped in a ” for an ajax html replacement. Like:

<td>
 <div id="ticket_grab_release_<%= ticket.id %>">
    *----  either a grab or release link here ----*
 <div>
</td>

So, the user clicks on ‘grab’: They are assigned the ticket, the worklist is updated with their info on the page via HTML replacements, and the grab link is replaced with a ‘release’ link.

Next to this is a ‘complete’ link. When the user clicks on that, a small complete form opens in a jQuery UI-Dialog window. I ran into a problem though because along with the grab/replace link changing I also had to toggle this ‘complete’ link with a grey non-link ‘complete’ or an actual ‘complete’ link (if ticket released – disable complete link or visa versa).

The problem is that if this ‘complete’ link was greyed out and I replaced that with a ‘complete’ link, the UI Dialog window would not open. Like (no idea what I’m saying) the link wasn’t in the DOM.

I got frustrated for a bit and then tried wrapping the script in a <div> and doing an html page replacement on the whole script. I HTML replaced the greyed out ‘complete’ with a ‘complete’ link and then HTML replaced the script right after. Interestingly that worked, but I’m really curious as to why it worked. When you ajax insert a script through an HTML replacement, does that inserted script have access to the modified DOM where the original script only has access to the what was the original DOM from the page load?

<div id="html_replace_sript">
    <script type="text/javascript">
      $('.complete_ticket_link' ).click(function(){
        var url = $(this).attr("href");
          $("#form_load").load(url,
            function() {
                $(this).dialog({
                        modal:true,
                        draggable: true,
                        resizable: false,
                        width:'auto',
                        height:'auto',
                        title: ' Complete Ticket ',
                        position: [125, 50]
                });
            });
        return false;
      });
    </script>
</div>

Thanks – much apprecaited!

  • 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-23T16:03:38+00:00Added an answer on May 23, 2026 at 4:03 pm

    Check out live()‘s much less recource-demanding counterpart: delegate()

    Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.

    That means that instead of having to look through the entire window for an element, it starts at the specified root, significantly reducing overhead. This is the best solution for your issue.

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

Sidebar

Related Questions

I have a page that displays a list of tickets. On each of these
We have a List that we outject into the page to be rendered and
I have the following gsp page: <g:def var=incidentMngmntId value=${incidentMngmntInstance?.id}/> <g:link controller=ticketMngmnt action=list params=[incidentMngmntId :
I have a website that does not have page refreshes when the visitor navigates
I have an Image in my login page that I want to show all
I have a code on my Ticket controller that displays all of the tickets
Here is my problem. I have a ticket-tracking system that is not very 'user
I have an object (Ticket), which has a list of other objects (Message). Message
I have a new items badge on a page that I want to update
I have function with simple sql query to list tickets on the page: class

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.