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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:55:14+00:00 2026-06-07T03:55:14+00:00

Is there anyway to improve my script run time? I have a script that

  • 0

Is there anyway to improve my script run time? I have a script that creates 2 listboxes: Listbox1 items is all my google site pages, listbox2 items is the sub-pages of listbox1 page. The script runs fine but sometimes it takes between 2 and 5 seconds to get all of the listbox2 items.

You can try my script here.

And here is my script:

function doGet() 
{
  var app = UiApp.createApplication();
  //GUI with 2 listbox
  //Listbox1: onclick > lbox1onclick(e), onchange > lbox1onchange(e)
  app.add(app.loadComponent("MyUrlParser")); 
  var lbox1 = app.getElementById('ListBox1');
  lbox1.addItem(' ');
  var lbox1_Item = SitesApp.getSite('phichdaica').getChildByName('manga').getChildren();
  for(var i = lbox1_Item.length-1; i >= 0; i--)
  {
      lbox1.addItem(lbox1_Item[i].getTitle());
  }
  return app;  

}

function lbox1onclick(e)
{
  var app = UiApp.getActiveApplication();
  var lbox2 = app.getElementById('ListBox2');
  lbox2.clear();
  return app;
}

function lbox1onchange(e)
{
  var app = UiApp.getActiveApplication();
  // var value = e.parameter.lbox1;
  var lbox1value = e.parameter.ListBox1;
  var lbox2 = app.getElementById('ListBox2');


  var lbox2_Item = SitesApp.getSite('phichdaica').getChildByName('manga').getChildByName(lbox1value).getChildren();

  for(var i=lbox2_Item.length-1; i >= 0; i--)
  {
    lbox2.addItem(lbox2_Item[i].getTitle());
  }
  return app;
}  
  • 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-07T03:55:15+00:00Added an answer on June 7, 2026 at 3:55 am

    I don’t think it will speed up the process but you could use just one handler function to do that : on change listBox1, clear listBox 2 and re-populate it immediately. What is taking some time is the call to site’s content so the difference might not be significative but the ‘logic’ of your script would be improved 😉

    Looking at your page, I see that listBox 2 is never cleared… is that a temporary issue ? Did you change something recently ?

    Also, what is supposed to happen when something is selected in listBox2 ?

    EDIT : following your comment, if you want to improve user experience concerning the ‘responsiveness’ of your UI the best way is to use client handlers to trigger the visibility of a ‘wait message‘ for example(something like “Updating the list“). I usually use an animated gif that I made visible with a client handler and that is made invisible again when the server handler returns (ie I set it invisible in the server handler function).

    here is a working example, just try to change the date in the upper right corner.

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

Sidebar

Related Questions

Is there anyway or any addin for VS2010 that can remove all the comments
I have this simple regex replace based routine, is there anyway to improve its
Is there anyway to improve the speed of this script by using lxml or
Is there anyway to serialize a List of datacontracts? I have created a datacontract
I have this code: <script language=javascript> $(function() { $('#items,#button-search').hide(); $(#companies).click(function() { $(this).attr(value,); $('#address,#new-company-form').empty(); });
Is there anyway to highlight the initial text in a textbox on a web
Is there anyway to get the Facebook ID of a user without forcing them
Is there anyway to create an ObjectSet from a DbSet ? Some background information:
Is there anyway to open the twitter app from an html link on an
is there anyway to get the class when click event is fired. My code

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.