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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:55:39+00:00 2026-05-28T04:55:39+00:00

Code Igniter version ‘2.0.3’ Jquery 1.7 Jquery History plugin I have a CodeIgniter app

  • 0
  • Code Igniter version ‘2.0.3’
  • Jquery 1.7
  • Jquery History plugin

I have a CodeIgniter app that I’ve built in an ajax fashion. I have a function as follows:

$(document).on('click','.ajax_link',function(e){
    //Stop the normal href action
    e.preventDefault();

    //Grab the destination URL
    var new_url = $(this).attr('href')
    
    //Grab the content via ajax and pass it to the history change function
    $.get(base_url+new_url,function(data){
        History.pushState({
            content:data.content,
            url:data.url
        }, data.title, data.url);
        //Refresh some site variables
        refresh();
    },'json');
});

All it does it captures clicks on anchor elements with a class of ajax_link and sends the response to a function that handles the placement of that response data into the page.

This works in Chrome and FF. I click the link, jQuery makes the get request, I get back a JSON object and my history.pushState() function injects some of the json data into my page.

The problem I have is in IE8. Essentially what’s happening is when I first open the app, the links work but they only work once. The second time I click a link it:

  • Does the ajax GET
  • Receives a response of 304 (Not Modified)
  • Doesn’t call the jQuery.get() callback function and therefore stops dead.

If I clear the cache it works again. So my assumption is that IE is doing the get request, but then it sees that it’s already requested that exact same file in the past… and so stops the process entirely.

Does anybody know of a solution to this? I have had a look for mentions of 304 errors and errors with ajax and caching in IE but have not found a problem identical to mine just yet.

Any help much appreciated

(Tested on Windows Virtual Machine IE8, and IE 8 Mode in Internet Explorer 9)

Solved

Just needed to add the following code to my document.ready function and the issue disappeared.

$.ajaxSetup ({cache: false});
  • 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-05-28T04:55:39+00:00Added an answer on May 28, 2026 at 4:55 am

    Change this line:

    var new_url = $(this).attr('href')
    

    To this:

    var new_url = $(this).attr('href') + '?' + Math.random();
    

    This is called a “CacheBuster” and effectively creates a url similar to:

    "website.com/page.html?1241233"
    

    That random number will be different for every click of “.ajax_link” so IE will think its a new page and get it properly.

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

Sidebar

Related Questions

I have an Codeigniter app (using version 2.1.0) that is writing a transaction to
I am using codeigniter and Jquery. I have an upload form in my view
I am running CI version 2.1 and I have recently installed the CodeIgniter 2.1
Am expanding a site built with codeigniter, its to have an api and mobile
I'm developing an app using Codeigniter 1.7.3 (yes, I know there's a new version,
I can't use Xdebug to debug an application built with Code Igniter, but I
Currently I am using codeigniter 2.0.2 version. I have searched all files but not
My base url function is not working in the latest version of code igniter.
I have a website that pages' contents loaded by ajax. All of my pages
I have created a mobile version of a site. It uses the CodeIgniter session

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.