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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:25:25+00:00 2026-05-15T07:25:25+00:00

I have an AJAX call which loads an Dialog page, now depending upon the

  • 0

I have an AJAX call which loads an Dialog page, now depending upon the content of the data returned on the AJAX call, I want to change the title of the Window, how do I do that.

Here is the snippet of code:

    var divid = "brHistoryForm";
    var url = "getRestoreFiles.action?profileName="+profileName;

    // Create xmlHttp
    var xmlHttp = AJAX();

    // The code...
    xmlHttp.onreadystatechange=function(){
        if(xmlHttp.readyState==4){
            document.getElementById(divid).innerHTML=xmlHttp.responseText;
        }
    }
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);

    $('#brHistoryForm').dialog('open');
    jQuery('#brHistoryForm').focus();

document.getElementById('pageTitle').innerHTML = "<h2>"+profileName+" - B&R History</h2>"

Here ‘pageTitle’ is a div. When I run the above piece of code, it opens a dialog window, the action is redirected to a jsp page which is loaded inside the div. It works fine, but the title does not get set :(.

I’ve tried to do the setting of the title in the redirected jsp page, it doesn’t work either.

Here is the code of that JSP page:

   <%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>B&R History</title>
    </head>
    <body>
         <table style="width: 100%">
            <tr>
                 <td style="width: 40%">
                    <div id="pageTitle">
                        <h2>B&R History</h2>
                    </div>
                 </td>
             </tr>
         </table>

         <table id="diskTable" cellpadding="0" cellspacing="0" border="1" class="display">
             <thead>
                 <tr>
                     <th>Select</th><th>Operation</th>
                     <th>Source</th><th>Destination</th>
                     <th>Status</th><th>Start Time</th><th>End Time</th>
                 </tr>
             </thead>
             <tfoot></tfoot>
             <tbody>
                 <s:iterator value="restoreFileList">
                     <tr>
                         <td>
                            <s:if test="%{status.equals('Finished')}">
                                <input onClick="loadRestoreForm('<s:property value="name"/>', '<s:property value="to_path"/>', '<s:property value="status"/>')" type="radio" name='chk' id="chk" value="<s:property value='id'/>,<s:property value="status"/>" >
                            </s:if>
                            <s:else>
                                 <input type="radio" name='chk' id="chk" value="<s:property value='id'/>,<s:property value="status"/>" disabled>
                            </s:else>
                         </td>
                         <td>
                            <s:if test="%{br_type == 0}">
                                Backup
                            </s:if>
                            <s:else>
                                Restore
                            </s:else>
                         </td>
                         <td><s:property value="from_path"/></td>
                         <td><s:property value="to_path"/></td>
                         <td><s:property value="status"/></td>
                         <td><s:property value="start_time"/></td>
                         <td><s:property value="end_time"/></td>
                     </tr>
                 </s:iterator>
             </tbody>
         </table>
    </body>
</html>

Any help would be appreciated.

  • 1 1 Answer
  • 1 View
  • 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-15T07:25:25+00:00Added an answer on May 15, 2026 at 7:25 am

    try

    // The code...
    xmlHttp.onreadystatechange=function(){
        if(xmlHttp.readyState==4){
            document.getElementById(divid).innerHTML=xmlHttp.responseText;
            document.getElementById('pageTitle').innerHTML = "<h2>"+profileName+" - B&R History</h2>";
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Ajax call which send form data to a page and
I want to scrape data from a page which loads DOM elements using Ajax
On my main page I have this jquery code which does an ajax call
I have an AJAX function which loads content from a file and displays in
i have an ajax for submit script on my html page, which loads a
I have a an ajax call that loads an HTML page into a div
I have a search page which performs an ajax call then generates results (dynamic
I have a jqgrid on my page which loads the first page of data
I have a jQuery dialog that loads its content trough ajax after its opened.
I have an element which autosaves its contents via an AJAX call. Currently, whenever

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.