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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:51:03+00:00 2026-06-11T19:51:03+00:00

Im working on bookmarklets and my issue is js not getting update I load

  • 0

Im working on bookmarklets and my issue is js not getting update

I load js file with my bookmarklet, And my problem is its not getting update with my latest version. even also if i have updated it in my database.

So what i want it to check and load latest version when ever bookmark is clicked. so i want to know if there something to add in js file so it get load latest version. Or if there is way to check date and time or check version. etc

I have no problem with codes as they working fine.

Suppose this is my js

function start() {
    // codes
};


//  ---------------------------------------
//  Ajax
//  ---------------------------------------
function AJAXInteraction(url, callback) {
    var req = init();
    req.onreadystatechange = processRequest;

    function init() {
        if (window.XMLHttpRequest) {
            return new XMLHttpRequest();
        }
        else if (window.ActiveXObject) {
            return new ActiveXObject("Microsoft.XMLHTTP");
        }
    }

    function processRequest() {
        if (req.readyState == 4) {
            if (req.status == 200) {
                if (callback) callback(req.responseText);
            }
        }
    }
    this.doGet = function () {
        req.open("GET", url, true);
        req.send(null);
    }
    this.doPost = function (str) {
        req.open("POST", url, true);
        req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
        req.send(str);
    }
};
  • 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-11T19:51:04+00:00Added an answer on June 11, 2026 at 7:51 pm

    If you are appending a JS file to the page and you want to force your browser to always get a fresh copy of the file and not use the cache, then you can append any random text as part of the query string. Here is example code.

    document.body.appendChild(document.createElement('script')).src = 'http://server.com/script.js?ts=' + new Date().getTime();
    

    Alternatively, the server from which the file is being loaded could specify certain expiration information. To ensure you always get the latest, you could specify an expiration of sometime in the past.

    Take a look at this: Setup HTTP expires headers using PHP and Apache

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

Sidebar

Related Questions

I'm working on a bookmarklet that gives the full path to an image when
I have a pretty typical bookmarklet code that's working perfectly for me in all
Working with Reporting Services 2008 r2. So here's my issue: We have 5 reports
I am writing some bookmarklets for a project that I am currently working on
Working on getting the Mercurial Source Control installed and working with Lotus Domino Designer
I have a little bookmarklet that opens up a new window, only problem is,
Hey guys -- The website I'm working on requires a bookmarklet launchable from your
I'm working on a bookmarklet for a Sub reddit and I'm trying to grab
I'm trying to get a simple bookmarklet working with Rails that creates a form
I have a JavaScript bookmarklet that is working fine in Chrome (v21) and Safari

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.