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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:25:07+00:00 2026-06-11T13:25:07+00:00

With the below code when I refresh it (using Jetty/Chrome FYI) I see: Hello

  • 0

With the below code when I refresh it (using Jetty/Chrome FYI) I see:

Hello World

Hello!!!

With the default css.

Then a delay and the “Click me” button appears, along with the referenced css. Any idea why? As you can see, myDiv is added immediately. If I comment out the onDocumentReady block then the page comes out immediately.

I assume its all the pulling in of extra js for the Ext button, but whatever the reason I’d like to know a good way of achieving a stable page refresh. I know I could have the body be diplay:none or visibility:hidden and turn it on at the end, but wondered if there is another, better way?

Thanks.


<html>
<head>
    <title>Hello Ext</title>

    <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
    <script type="text/javascript" src="extjs/ext-debug.js"></script>
</head>
<body>
<h1>Hello World</h1>
</body>
<script>
    var myDiv=Ext.DomHelper.append(Ext.getBody(), {tag: 'div', cls: 'new-div-cls', id: 'new-div-id',html:'Hello!!!'});

    Ext.onDocumentReady(function(){
    var button=Ext.create('Ext.Button', {
        text: 'Click me',
        renderTo: Ext.getBody(),
        handler: function() {
            alert('You clicked the button!');
        }
    })
    })
</script>
</html>
  • 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-11T13:25:08+00:00Added an answer on June 11, 2026 at 1:25 pm

    Using Ext.onReady in place of Ext.onDocumentReady should do the trick but most Ext apps work best if Ext writes all of the content. Ext adds styles to the entire document when the JavaScript library loads.

    Below the title tag, you can add a style tag that will prevent text from showing until Ext is loaded and applied.

    In your html header:

    <title>Hello Ext</title>
    
    <style>
        body {
            color: #fff;
        }
    </style>
    

    In your existing script tag:

    Ext.onReady(function(){
        var myDiv = Ext.DomHelper.append(Ext.getBody(), {
             tag: 'div', 
             cls: 'new-div-cls', 
             id: 'new-div-id',
             html:'Hello!!!'
        });
    
        var button = Ext.create('Ext.Button', {
            text: 'Click me',
            renderTo: Ext.getBody()
        });
    
        button.on('click', function() {
            alert('You clicked the button!');
        });
    
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have refreshed the browser in WebDriver using java as below code: driver.navigate().refresh(); How
Below code makes form to be submitted without html5 validation... $j(document).on(click, #client_entry_add, function(event){ ajax_submit();});
In below code when I click 'Vote' a vote results screen is displayed but
I am trying to generate the below code via T4. using System; using MyDAL;
I have the css code below along with an image to show it's output.
I'm using the below code to put an overlay on my MapView. For some
Problem: I'm attempting to disable a radio button by using the code below. This
I'm using this code below so randomly place images, within a container, from each
The code below is not working for some reason. As I click at test
I'm using code below to drag CEikRichTextEditor contents up and down (Scroll) on touch

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.