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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:59:20+00:00 2026-06-14T16:59:20+00:00

index.php // load jquery.js and jquery.ui.js $(#dialog_a).load(template_a.php).dialog(); $(#dialog_b).load(template_b.php).dialog(); template_a.php just HTML, no JS template_b.php

  • 0

index.php

// load jquery.js and jquery.ui.js
$("#dialog_a").load("template_a.php").dialog();
$("#dialog_b").load("template_b.php").dialog();

template_a.php

just HTML, no JS

template_b.php

// !!! -> load jquery.js and jquery.ui.js <- !!!
$("#dialog").load("template_c.php").dialog({modal:true});

As you can see, I load two dialogs. #dialog_a just loads text without any function BUT #dialog_b loads a stand-alone-script which includes jquery and jquery.ui again.

After opening #dialog_b (by anchor/onclick) it’s not possible to access objects in the index.php (e.g. closing a dialog). For me it seems like template_b.php overwrites the DOM. But I’ve no idea how to fix this problem. Do you have?

Thanks in advance!

  • 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-14T16:59:22+00:00Added an answer on June 14, 2026 at 4:59 pm

    Solution: use the jQuery live() function!

    index.php

    $(".anchor_in_dialog_or_not_doesnt_matter").live("click", function() {
        $("#dialog").dialog();
    });
    

    template_b.php

    if ($_GET["standalone"])
        // load jquery, jquery.ui
    endif;
    

    I hope it helps somebody!

    Edit: As adamb already mentioned below, use on() instead of live()!

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

Sidebar

Related Questions

i have got <div><a class='link' href='index.php' data-container='target'>Load</a></div> <div class='target'></div> i need to write jquery
i am using php 5.2.8 i have index.html, which loads LOAD.PHP from IFRAME. iframe
I am trying to load two modal dialog boxes with Jquery. Both of them
I am using the following JQuery plugin to load an image slider http://www.orionseven.com/imageloader/index.php However
On my index.php page I use the jquery load() to load other pages in
How can I post data using Jquery from selected data to the PHP? HTML
I have the following code working nicely: $field2.on(change, #selector, function(){ $field2.load(./index.php?show-options=true, { value: $(this).val()
I have index.php and use jQuery .load() to load content from load.php. When I
<?php class Email extends Controller { function Email() { parent::Controller(); $this->load->library('email'); } function index()
I have a page index.php that uses a modal to upload files. After those

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.