javascript - 瀑布流返回的控制

WBOY
Release: 2016-06-06 20:23:38
Original
1625 people have browsed it

正常瀑布流使用ajax请求返回json数据,每一次请求后使用history.replacestate改变url的page参数,jQuery(document).ready(function($){});里面默认有一个加载第一组瀑布流数据方法,现在问题是:进入详情后返回首页要求阻止一次ready里加载第一组数据的方法。返回的触发事件window.addEventListener("popstate", function() {//返回时加载localstorage数据,控制滚动条});

我的思路是:需要在返回时阻止一次,另外打标志不行。不清楚onpopstate和ready(),给点思路和建议。

回复内容:

正常瀑布流使用ajax请求返回json数据,每一次请求后使用history.replacestate改变url的page参数,jQuery(document).ready(function($){});里面默认有一个加载第一组瀑布流数据方法,现在问题是:进入详情后返回首页要求阻止一次ready里加载第一组数据的方法。返回的触发事件window.addEventListener("popstate", function() {//返回时加载localstorage数据,控制滚动条});

我的思路是:需要在返回时阻止一次,另外打标志不行。不清楚onpopstate和ready(),给点思路和建议。

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!