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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:21:35+00:00 2026-05-21T19:21:35+00:00

I have 2 simple pages. Index contains a hyperlink with an anchor tag which

  • 0

I have 2 simple pages.

Index contains a hyperlink with an anchor tag which with jquery has a function click defined.
The page also contains a DIV called “container”

The click function opens a dailog using .dialog()

The dialog page itself is a second page in which i try to close the dialog but this doesnt work.

Can you explain me why this is not working?

====== CODE FROM INDEX PAGE ===========

<script type="text/javascript">
    $().ready(function () {
        $("#LaunchModal").click(function () {
            $.get(
                "Home/RandomPopupView",
                function (htmlResult) {
                    $("#RandomModal").remove(); //In case this is the second time they've requested the dialog.
                    $("#container").append(htmlResult);
                    $("#RandomModal").dialog();
                }
            );
            return false; //To keep the default behavior of the anchor tag from occuring.
        });
    });
</script>
<a href="" id="LaunchModal">Launch Modal!</a>
<div id="container">

====== CODE FROM DIALOG PAGE ===========

<div id="RandomModal">
    <script type="text/javascript">
        $().ready(function () {

            //TEST TRY TO CLOSE THE DIALOG DIV IMMEDIATELY FROM WITHINN THE DIV ITSELF
            $("#RandomModal").dialog("close"); //CLOSE DOES NOT WORK

            $("#submitModal").click(function () {
                var SomeString = $("#SomeString").val()

                $.post("/Home/RandomPopupViewPOST",
                {
                    SomeString: SomeString
                },
                    function (html) {
                        $("#RandomModal").empty();
                        $("#RandomModal").append(html);
                    });
            });
        });
    </script>
</div>

=======================================

  • 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-21T19:21:36+00:00Added an answer on May 21, 2026 at 7:21 pm

    the get method doesn’t load a page you would need to load iframe to get ready event on second page to trigger

    so I would us put your code in the main page and use live event

    $("#submitModal").live("click",function () {
        var SomeString = $("#SomeString").val()
    
        $.post("/Home/RandomPopupViewPOST",
        {
            SomeString: SomeString
        },
            function (html) {
                $("#RandomModal").empty();
                $("#RandomModal").append(html);
            });
    });
    

    though I’m not sure thats the right solution either the more i read your code the more I don’t understand what your trying to do

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

Sidebar

Related Questions

I have a simple html page with a div. I am using jQuery to
Ok, i have simple scenario: have two pages: login and welcome pages. im using
Imagine that you have a simple site with only 2 pages: login.aspx and secret.aspx.
To keep things simple, we have a few aspx pages... Page1.aspx - resets Session
I have a simple page with my ScriptManager and my UpdatePanel , and my
K... I'm doing something obviously wrong. I have a simple page with a file
I have a simple web page that till now didn't need any login. It
I have a simple cart page that displays items that are in someones cart,
I have this simple Jsp page: <%@ page language=java import=java.awt.Color%> <% Color background =
I have a simple accordion type page containing a list of H3 headers and

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.