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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:57:06+00:00 2026-05-30T14:57:06+00:00

this is my action script action.js function showDistrict() { //alert(hello); $.ajax({ url: ‘dialog_applet.jsp#dialog-modal-district’, success:

  • 0

this is my action script

action.js

function showDistrict() { //alert("hello");
    $.ajax({
        url: 'dialog_applet.jsp#dialog-modal-district',
        success: function(msg) {
            document.getElementById("dialog-content-district").innerHTML = msg;
        }
    });
    $(function() {
        $("#dialog:ui-dialog").dialog("destroy");
        $("#dialog-content-district").dialog({
            height: 300,
            width: 350,
            modal: true
        });
    });
    // alert("hello1");
}

function showCity() { //alert("hello");
    $.ajax({
        url: 'dialog_applet.jsp#dialog-modal-city',
        success: function(msg) {
            document.getElementById("dialog-content-city").innerHTML = msg;
        }
    });
    $(function() {
        $("#dialog:ui-dialog").dialog("destroy");
        $("#dialog-content-city").dialog({
            height: 300,
            width: 350,
            modal: true
        });
    });
    // alert("hello1");
}​

this is my content script which is inside of dialog_applet.jsp

<div id="dialog-modal-district">

dialog-modal-district is here
</div>
<div id="dialog-modal-city">
dialog-modal-city is here
/applet>

on call of any one function showDistrict() or showCity(). it is showing contents of both <div> . But, i want to retrieve the particular <div> contents, which has been called. I mean on call of showDistrict, it will only show the dialog-modal-district is here, but it is showing dialog-modal-district is here dialog-modal-city is here

Any help appreciated !!
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-05-30T14:57:07+00:00Added an answer on May 30, 2026 at 2:57 pm

    I see now what is the problem.

    Unfortunately, using an url dialog_applet.jsp#dialog-modal-district will load completely the content of the jsp page, not only the fragment you specify.

    You have two options to achieve what you want.

    1. Extract yourself the actual content you want to insert into the dialogs. The ajax request will load the full jsp page, using the .find() method you can select the part that interests you and only append it to your dialog:

      success: function(msg) {
          // "msg" is the full jsp page
          $(msg)
              // select the part you want
              .find('#dialog-modal-district')
              // append it to your dialog
              .appendTo($("#dialog-content-district"));
      }
      
    2. Use the .load() method from jQuery. Its role is to load content from the specified url and it allows to load document fragments automatically by using a url syntax a little like the one you tried to use:

      $("#dialog-content-district")
          .load('dialog_applet.jsp #dialog-modal-district');
      

      Note the white-space between the jsp page and the ID selector, this is important to keep it, otherwise it won’t work.

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

Sidebar

Related Questions

I have a action script from a decompile flash like this public function getResourceAsByteArray(resID:int):flash.utils.ByteArray
I have this action script code that is working perfectly but i am try
I have this action script that pulls images from a xml file > myPhoto
Is there way to make function in Action Script, or any other language, to
I got function in Flash (Action Script 3) - that makes snowflakes falling. Now
I got an if-else script: $('#favitem').live('click', function () { var fid = $(this).parent().attr('id'); if
I have a problem while reading from XML file in action script 3. This
<body> <script type=text/javascript> function name(firstname) { alert(Your firstname: + firstname); } </script> <form> <input
In Actionscript, the Unix timestamp in milliseconds is obtainable like this: public static function
I have a function like this in actionscript3 private function uploadFile(event:MouseEvent):void { var uploader:URLRequest

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.