using jquery mobile and codeigniter framework php

狂风中的少年 提交于 2019-12-25 08:27:26

问题


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>

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


回答1:


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>

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.


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

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


来源:https://stackoverflow.com/questions/9284918/using-jquery-mobile-and-codeigniter-framework-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!