如何在一个应用程序使用jQuery Mobile和骨干JS在一起吗? [英] How to use jQuery Mobile and Backbone JS together in one app?

查看:78
本文介绍了如何在一个应用程序使用jQuery Mobile和骨干JS在一起吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用JS骨干为iPad的HTML5项目享受......但我很快运行到需要的iPad十岁上下的转变,表单元素等环顾四周后的问题,似乎jQuery Mobile的是最成立。我们使用jQuery进不去。

I've been enjoying using Backbone JS for a iPad HTML5 project... But I'm quickly running into a issue of needing iPad-ish transitions, form elements etc. After looking around, it seems jQuery Mobile is the most established. We use jQuery anyhow.

但有一件事我赶紧跑进是两个库的散列事件/ AJAX的东西很快没有工作。因为jQuery Mobile的负责加载页面中,做过渡等照顾,这不是让我的主干航线控制器工作,因为他们以前那样。看来,这两个实际上并没有那么兼容?

But one thing I quickly ran into was the hash events/ajax stuff of the two libraries quickly didn't work. Because jQuery Mobile takes care of loading in pages, and doing the transitions etc, it was not letting my Backbone Controller routes work as they did before. It seemed that the two aren't actually that compatible?

在一些工作,虽然,我有一个基本的解决办法...使用jQuery Mobile的页面加载事件东西看活动页面它,然后开火正确的骨干查看与该页面去。基本上废除完全骨干哈希听/路由/控制器。

After some work though, I have a basic workaround... Using the page loading events stuff in jQuery Mobile to see the active page it's on and then fire the correct Backbone View that goes with that page. Basically doing away completely with Backbone's hash listening/routes/controller.

但是,这仍然看起来不正确?如何骨干JS和jQuery Mobile的无缝地协同工作?我怎么做的权利,前进?

But this still doesn't seem right? How can Backbone JS and jQuery Mobile work seamlessly together? How do I do this right, moving forward?

推荐答案

我想我找到了解决办法,当我问同样的问题。

I think I found a solution when I asked the same question.

<一个href=\"http://stackoverflow.com/questions/5531822/disable-the-hash-change-controller-in-jquery-mobile-ui-and-replace-with-backbone\">Disable在jQuery Mobile的UI哈希变化控制器和替换Backbone.js的

有看起来是禁用JQuery的哈希变化监听最近检查的选项。

There looks to be an option to disable JQuery hash change listening on a recent checking.

<一个href=\"https://github.com/jquery/jquery-mobile/commit/3162428558efd9960739ef8f00a7ead0dbf6d3ec\">https://github.com/jquery/jquery-mobile/commit/3162428558efd9960739ef8f00a7ead0dbf6d3ec

我还没有尝试过呢,虽然。如果一切正常,请告诉我们。

I have not tried it yet though. If it works please let us know.

布拉德

这篇关于如何在一个应用程序使用jQuery Mobile和骨干JS在一起吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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