当我使用GET变量时,在phonegap应用程序中导航失败 [英] Navigation in phonegap application fails when I use GET variables

查看:116
本文介绍了当我使用GET变量时,在phonegap应用程序中导航失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个小型的2页面应用程序,但是当我使用GET变量导航到页面时失败,例如

  window.location.href ='game.html?id = 2'

使用 www / game.html 效果很好,但打破了逻辑。



上面的 window.location.href throws

  CordovaBrowser_NavigationFailed :: www / game.html?id = 2 


解决方案

将'?'符号替换为#我测试,它工作正常



详细:



原始代码
window.location.href ='game.html?id = 2' / p>

替换为
window.location.href ='game.html#id = 2'



Jquery for windows phone不支持'?'符号


I've created a small 2 page application, but it fails when I navigate to a page using GET variables, like

window.location.href = 'game.html?id=2'

Navigating by using www/game.html works great, but breaks the logic. Could anyone tell me why this is?

The above window.location.href throws

CordovaBrowser_NavigationFailed :: www/game.html?id=2

解决方案

Replace '?' symbol with # I tested, it works fine

Detailed:

Original code window.location.href = 'game.html?id=2'

Replace as window.location.href = 'game.html#id=2'

Jquery for windows phone doesn't support '?' symbol

这篇关于当我使用GET变量时,在phonegap应用程序中导航失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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