使用jQuery移动和codeigniter框架php

问题描述:

我使用codeigniter框架创建jQuery移动网站。如果我开始我的项目,而不使用jquery mobile在头一切工作,但如果我插入jquery移动在我的页面的头部,并尝试开始我的项目,我收到一个灰色页面上写入 undefined 。我想要明确表示我不在我的页面中使用任何脚本只有我在头中调用:

I'm creating jquery mobile site using codeigniter framework.If I start my project without using jquery mobile in the head everything work but if I insert jquery mobile in the head of my page and try to start my project I receive a gray page with write on undefined. I want explicity say that I'm not using any scripts in my page only I call in the head :

<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>

这是使用jquery mobile的脚本。这可能是因为我不是javascript的专家

which are the scripts to use jquery mobile. Which could be the cause since I'm not expert in javascript

也许这是一个问题与noConflict?

Perhaps it is an issue with noConflict?

http://api.jquery.com/jQuery.noConflict /

<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
<script type="text/javascript">
    jQuery.noConflict();
</script>






更新:这是data-url的问题jquery mobile使用的属性。 JQMobile使用该属性更新URL,所以如果没有设置,重定向或其他导航将不会更新使用JQMobile时的URL。


Update: it is an issue with data-url attribute used by jquery mobile. JQMobile uses that attribute to update the URL, so if it isn't set, redirects or other navigation won't update the url when using JQMobile.

更新到更新:关键是关闭ajax的形式:

Update to the update: the key was turning off ajax in the form:

<form action="" method="POST" accept-charset="utf-8" data-ajax="false">