Home >Web Front-end >Bootstrap Tutorial >How to solve bootstrap cache

How to solve bootstrap cache

angryTom
angryTomOriginal
2019-07-29 16:01:422171browse

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();});

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})  
}

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!

Statement:
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