html、javascript代码在我的pc浏览器上运行良好,但在我的windows phone应用程序上却无法运行

html、javascript代码在我的pc浏览器上运行良好,但在我的windows phone应用程序上却无法运行,javascript,windows-phone-8,winjs,visual-studio-cordova,Javascript,Windows Phone 8,Winjs,Visual Studio Cordova,我正在尝试制作一个WindowsPhone8.1应用程序,使用HTML5CSS和javascript发送get请求。唯一的问题是我的代码在我的浏览器上运行,但是当我使用visual studio构建应用程序时,get请求只在第一次发送。我不知道为什么会这样。 该页面的代码如下所示: <!DOCTYPE html> <html> <head> <meta content="text/html;charset=utf-8" http-equiv="Conte

我正在尝试制作一个WindowsPhone8.1应用程序,使用HTML5CSS和javascript发送get请求。唯一的问题是我的代码在我的浏览器上运行,但是当我使用visual studio构建应用程序时,get请求只在第一次发送。我不知道为什么会这样。 该页面的代码如下所示:

<!DOCTYPE html>
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script>

$(document).ready(function()
{
   $("button").click(function()
        {
         $.get("http://192.168.1.100/gpio/0")
        });
} );
</script>
</head>
<body>

<button>Send GET request </button>

</body>
</html>

$(文档).ready(函数()
{
$(“按钮”)。单击(函数()
{
$.get(”http://192.168.1.100/gpio/0")
});
} );
发送获取请求
我在应用程序中使用的代码与此相同,只是做了一些更改:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>App1</title>

<!-- WinJS references -->
<link href="//Microsoft.WinJS.2.0/css/ui-dark.css" rel="stylesheet" />
<script src="//Microsoft.WinJS.2.0/js/base.js"></script>
<script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

<!-- App1 references -->
<link href="/css/default.css" rel="stylesheet" />
<script src="/js/default.js"></script>
<script src="/js/jquery-1.12.1.js"></script>
<script>

$(document).ready(function () {
    $("button").click(function () {
        $.get("http://192.168.1.100/gpio/0")
    });
    });
</script>
</head>
<body>

<button>Send GET request</button>

</body>
</html>

附件1
$(文档).ready(函数(){
$(“按钮”)。单击(函数(){
$.get(”http://192.168.1.100/gpio/0")
});
});
发送获取请求

您的手机和PC是否连接到同一局域网?这是wifi模块(esp8266)的地址,在本例中,该模块被编程为服务器。事实上,该应用程序只工作了一次,这是我第一次按下按钮。检查webrequest缓存是否对此行为负责。这可能会有帮助。@Jagannath谢谢你,伙计。这就是问题所在