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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:53:10+00:00 2026-05-31T11:53:10+00:00

I have a really annoying issue with jQuery and/or the jQuery UI Dialog Box.

  • 0

I have a really annoying issue with jQuery and/or the jQuery UI Dialog Box.

After clicking on a special link a modal dialog will pop up with some loaded content (ajax) and inside this loaded content are new links/buttons that load their url inside the same div Box, so the dialog still is loaded, but with new content then. The Problem is, that if you link on that link (inside a fresh loaded dialog box and on a recently reloaded website) it works as it should, but with the second click it loads the url twice, with the third it loads 4 times … It growing exponentially with every new link loaded inside the dialog. I testet this with a counter stored inside $_SESSION.

This is the Javascript Code:

var somedialog = $('<div></div>').dialog({
  autoOpen: false,
  resizable: false,
  modal: true,
  /*show: 'fade',
  hide: 'puff',*/
  closeOnEscape: true,
  close: function(){
  }
 });
 function openInDialog(url, title, width, height)
 {
  somedialog.empty();
  somedialog.dialog("option", "width", width);
  somedialog.dialog("option", "height", height);
  somedialog.dialog("option", "title", title);
  somedialog.load(url,{},function (responseText, textStatus, XMLHttpRequest)
   {
    somedialog.dialog('open');
   }
  );

  //somedialog.load(url,{},function (responseText, textStatus, XMLHttpRequest){
  // dialogdiv.somedialog('open');
  //});
 }

 $('a.ajaxBuyItemDialog').on('click',function(){
  openInDialog(this.href, this.title, 400, 300);
  //prevent the browser to follow the link
  return false;
 });

There seemed to bee other people with this issue, but that was not a very effective discussion: https://stackoverflow.com/questions/6471360/jquery-load-after-load-repeated-results-problem

Thanks for your help!

EDIT:
This is part of the code which is located in the loaded script:

$("#_BUYITEM_FORM").live('submit', function(){
    $.ajax({ // create an AJAX call...
        data: $(this).serialize(), // get the form data
        type: $(this).attr('method'), // GET or POST
        url: $(this).attr('action'), // the file to call
        success: function(response){ // on success..
            $("#_BUYITEM_CONTENT").html('<p class="AjaxLoaderImg"><span>Einen Moment bitte...</span></p>');
            $("#_BUYITEM_CONTENT").html(response); // update the DIV
        }
    });
    return false; // cancel original event to prevent form submitting
});

Without it I can’t get it to refresh the dialog box with new content.

  • 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-31T11:53:11+00:00Added an answer on May 31, 2026 at 11:53 am

    “Dirty” solution

    function watchBuyItemForm(){
            $("#_BUYITEM_FORM").submit(function(){
                $.ajax({ // create an AJAX call...
                    data: $(this).serialize(), // get the form data
                    type: $(this).attr('method'), // GET or POST
                    url: $(this).attr('action'), // the file to call
                    success: function(response){ // on success..
                        somedialog.html(ajaxLoader);
                        somedialog.html(response); // update the DIV
                        watchBuyItemForm();
                    }
                });
                return false; // cancel original event to prevent form submitting
            });
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a really annoying issue. Im trying to create a page with a
Ive got ths really annoying issue I have grouped a set of data and
I have ran into a really annoying issue which gives me this error: The
I have a really annoying intermittent issue when loading a series of assets using
I come to you because I have this really annoying issue. In Xcode, I
Hey I have a really annoying IE7 bug that I am trying to work
I am stuck with something quite simple but really annoying: I have an xml
I have some really complicated legacy code I've been working on that crashes when
I'm have a very annoying issue with a textarea when trying to retrieve its
I do experience a really annoying problem with TestNG and RESTeasy. I do have

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.