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

  • Home
  • SEARCH
  • 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 8423527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:44:47+00:00 2026-06-10T03:44:47+00:00

I have a webpage with a lot of javscript functions. It was a requirement

  • 0

I have a webpage with a lot of javscript functions. It was a requirement for the job to have a single html file and call all the sections inside the same page and replace the “old content” with the new one without leaving the page. (Please don’t tell me if it was a good idea or not.)

So, all of them are necesary for the site to work, but it is not necesary to load them at the beggining. Is there any form to load and call functions when clicked a button?

I will appreciate a lot your help.

  • 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-10T03:44:49+00:00Added an answer on June 10, 2026 at 3:44 am

    I suggest that you put the javascript in two files.

    In file 1 you put the bare minimum and in file 2 the rest. You can load file 2 when you want by doing something like this:

    var script = document.createElement('script');
    script.type = 'application/javascript';
    script.src = 'name_of_script_2.js';
    document.head.appendChild(script);
    

    You should also look into minification and compression. For example Googles closure compiler. (start with just white-space-optimization and then try simple optimization. The advanced optimization requires special things to work) And make sure you gzip your files to make them as small as possible.

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

Sidebar

Related Questions

I have a webpage which content(single div and a lot of text with formatting)
I have a webpage. I have a javascript file that does a whole lot
I have a section of a webpage that loads a JavaScript file from an
I have a webpage made of a lot of PHP and Jquery/javascript I have
I have been searching all over the internet tonight, saw a lot of solutions
I have a webpage with a lot of items in it. On the page,
So my webpage uses a lot of jquery everywhere, It is a single page
I have a question for all the html and dojo people. I want when
I have a webpage that does a lot of processing in JavaScript and creates
I have a webpage with a lot of inputs, and would like to set

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.