无法理解History.js,需要简化吗? [英] Can't understand History.js, need it simplified?

查看:85
本文介绍了无法理解History.js,需要简化吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对编程很新,而且我在jQuery的帮助下创建了一个AJAX网站。

I'm fairly new to programming, and I'm making an AJAX site with the help of jQuery.

我已经环顾了一下AJAX历史记录处理程序,并认为History.js似乎是最好的/最新的。

I've looked around a fair bit for an AJAX history handler, and figured that History.js seems to be the best/most up-to-date.

我的菜单按钮每个都有自己唯一的ID(#homeBtn) ,#featureBtn,#pricingBtn),目前看起来像这样:

My menu buttons each have their own unique ID's (#homeBtn, #featuresBtn, #pricingBtn), and currently look like this:

< a href =#homeclass =homeMainMenuButtonid =homeBtn>< div class =homeMainMenuButtonText>主页< / div>< / a>

有人可以给我一个例子(最好是在jsfiddle上)我将如何实现History.js?

Can someone give me an example (preferably on jsfiddle) on how I would implement History.js?

我似乎无法掌握作者给出的任何例子,并且我只需要一个愚蠢的版本= b

I can't seem to grasp any of the examples given by the author, and I simply need a dumbed down version =b

如果您需要更多信息,请告诉我,谢谢!

If you need any more information, please let me know, and thanks!

推荐答案

按照此处的说明操作: https://github.com/browserstate/ajaxify

Follow the instructions here: https://github.com/browserstate/ajaxify

更改指向传统链接的链接 href =#home href =/ home - 确保 http://mywebsite.com/home 有效。这就是优雅的升级。

Change your links to traditional links href="#home" to href="/home" - make sure http://mywebsite.com/home works. This is all about graceful up-gradation.

这篇关于无法理解History.js,需要简化吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆