最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Forcing reload of page using Framework7 - Stack Overflow

programmeradmin2浏览0评论

I am building a small webapp based on framework7 example split-view-panel which has a navigation bar on the left and if you click it loads a url to the right hand pane.

This is a php url. However it seems that each time you click on the left, if the page has previously been loaded, it simply reloads from cache. However I need it to call the php page again as I need to log time data on the php page for when it was clicked and loaded.

Is there a way I can force Framework7 to reload pages it has previoulsy loaded via ajax?

I am building a small webapp based on framework7 example split-view-panel which has a navigation bar on the left and if you click it loads a url to the right hand pane.

This is a php url. However it seems that each time you click on the left, if the page has previously been loaded, it simply reloads from cache. However I need it to call the php page again as I need to log time data on the php page for when it was clicked and loaded.

Is there a way I can force Framework7 to reload pages it has previoulsy loaded via ajax?

Share asked Dec 19, 2015 at 9:15 Toby AllenToby Allen 11.3k12 gold badges79 silver badges131 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 2

You can have Framework7 ignore certain URLs or even disable caching all together. Refer to the link below (section: Caching) for more details:

http://www.idangero.us/framework7/docs/init-app.html#.VnfJtPlVhHw

You must use pushState! so where you define framework7 you must include this

var myApp = Framework7({
    // Other Parameters if already there
    pushState: true
});

What this is doing is enabling a HTML5 feature called the History API which did not exist in HTML4 i think was the last version anyway people used to use a thing called root hashing (Just so you know this back story is off the top of my head but the code it what will make it work) which is basically what the PushState is in the History API just. Just so you know PushState in Framework7 will make your URL'S look like this http://example./#!/profile.php?parameters4get=joe but it doesn't affect how Framework7 handles your pages it just enabled the PHP to be reloaded each time.

For Framework7 v4 use

var myApp = Framework7({
    view : {
        pushState: true
    }
});
发布评论

评论列表(0)

  1. 暂无评论