开发者

jquery mobile error loading page with symfony URL

I have a problem when loading a symfony URL like this

<li><a id="offers" type="button">Offers</a></li>
$("#offers").click(function() {
    $.mobile.changePage("/site/offers","flip",false,true);
})

instead if i load an "usual" URL like this

$.开发者_开发技巧mobile.changePage("/index.php","flip",false,true);

it works fine.

PS: using tag

<a href="/site/offers" data-transition="flip" rel="external"> 

it works fine except the transition.

Thanks


You should probably let Symfony determine which web controller to use so you could use the url_for method:

<li><a id="offers" type="button">Offers</a></li>
$("#offers").click(function() {
    $.mobile.changePage("<?php echo url_for('/site/offers'); ?>","flip",false,true);
})

Alternatively you can hardcode it:

<li><a id="offers" type="button">Offers</a></li>
$("#offers").click(function() {
    $.mobile.changePage("/index.php/site/offers","flip",false,true);
})

And jQuery Mobile ignores page transitions on external or no-ajax requests so if you want the transition to work within your link use:

<a href="/site/offers" data-transition="flip"> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜