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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:51:47+00:00 2026-06-02T20:51:47+00:00

I am looking for an equivalent to jquery’s load() method that will work offline.

  • 0

I am looking for an equivalent to jquery’s load() method that will work offline. I know from jquery’s documentation that it only works on a server. I have some files from which I need to call the html found inside a particular <div> in those files. I simply want to take the entire site and put it on a computer without an internet connection, and have that portion of the site (the load() portion) function just as if it was connected to the internet. Thanks.

Edit: BTW, it doesn’t have to be js; it can be any language that will work.

Edit2:
My sample code (just in case there are syntax errors I am missing; this is for the files in the same directory):

function clickMe() {
    var book = document.getElementById("book").value;
    var chapter = document.getElementById("chapter").value;
    var myFile = "'" + book + chapter + ".html'";
    $('#text').load(myFile + '#source')
}
  • 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-02T20:51:49+00:00Added an answer on June 2, 2026 at 8:51 pm

    You can’t achieve load() over the file protocol, no other ajax request is going to work for html files. I have tried even with the crossDomain and isLocale option on without anything success, even if precising the protocol.

    The problem is that even if jQuery is trying the browser will stop the request for security issues (well most browsers as the snippet below works in FF) as it allows you to load locale file so you could get access to a lot of things.

    The one thing you could load locally is javascript files, but that probably means changing a lot of the application/website architecture.

    Only works in FF

    $.ajax({
        url: 'test.html',
        type: 'GET',
        dataType: 'text',
        isLocale: true,
        success: function(data) {
            document.body.innerHTML  = data;
        }
    });
    

    What FF does well is that it detect that the file requesting local files is on the file protocol too when other don’t. I am not sure if it has restriction over the type of files you can request.

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

Sidebar

Related Questions

Is there a jQuery equivalent to prototype's defer? I'm looking for something that will
I'm looking for the equivalent to CTRL-Q of IntelliJ, that shows you the documentation
I'm looking for the equivalent in Qt to GetTickCount() Something that will allow me
I'm looking for the equivalent of the Unix 'tail' command that will allow me
I experienced with JQuery and new to YUI. I'm looking for YUI's equivalent of
I'm looking to do the equivalent of Python's inspect.getargspec() in Javascript. I do know
I'm looking for a book (or equivalent) to help me go from using hg
I'm looking for a jQuery function or plugin that serializes form inputs to an
I'm looking for a jQuery(or jQuery plugin) equivalent of this C# code block. What
jQuery has a lovely if somewhat misnamed method called closest() that walks up the

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.