How to solve bootstrap cache

angryTom
Release: 2019-07-29 16:01:42
Original
2063 people have browsed it

How to solve bootstrap cache

If you want to know more about Bootstrap, you can click: Bootstrap Tutorial

Bootstrap's cache sometimes slows down the loading speed of web pages. Let me introduce to you how to clear bootstrap's cache.

1. Bind the event and clear the data directly when closing:

$("#model").on("hidden.bs.model",function(e){$(this).removeData();});
Copy after login

2. Modify the requested url and add Random parameters, forced refresh, first use jQuery's get method to get the content, and then put it in the modal. is as follows:

function remoteUrl(u){  
    u += '&t=' + Math.random(1000)  
    $.get(u, '', function(data){  
        $('#remoteModal .modal-body').html(data)  
    })  
    $('#remoteModal').modal({show:true,backdrop:false})  
}
Copy after login

The above is the detailed content of How to solve bootstrap cache. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!