【发布时间】:2014-02-22 10:00:12
【问题描述】:
我一直在 APPHOST9601:无法加载 http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js。应用无法在本地上下文中加载远程 Web 内容
请注意,我只有 14 岁,对此完全陌生。只是在尝试做点什么。
我四处寻找,找不到解决方案。 该项目是一个从 bter.com api 提取数据并显示的跟踪器。没有什么花哨。 在正常的 index.html 上效果惊人。 Windows 8 应用程序,我这辈子都不能让它工作:(。我一直在这只是在一个普通的 index.html 文件中布置东西,现在我的应用程序几乎要退出了。 这是我的代码 - home.html 文件
更新:似乎我已经想通了。 创建新的 .js 文件,添加脚本,调用它,一切都很好。所以它看起来。敲木头。 - 仍然愿意接受您可能提供的任何帮助/支持
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>homePage</title>
<!-- WinJS references -->
<link href="//Microsoft.WinJS.1.0/css/ui-dark.css" rel="stylesheet" />
<script src="//Microsoft.WinJS.1.0/js/base.js"></script>
<script src="//Microsoft.WinJS.1.0/js/ui.js"></script>
<link href="/css/default.css" rel="stylesheet" />
<link href="/pages/home/home.css" rel="stylesheet" />
<script src="/pages/home/home.js"></script>
<script src="/js/jquery-2.0.0.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
</head>
<body>
<!-- The content that will be loaded and displayed. -->
<div class="fragment homepage">
<header aria-label="Header content" role="banner">
<button class="win-backbutton" aria-label="Back" disabled type="button"></button>
<h1 class="titlearea win-type-ellipsis">
<span class="pagetitle">Welcome to App1!</span>
</h1>
</header>
<section aria-label="Main content" role="main">
<p>Content goes here.</p>
Current Exchange Rate: <div id="ticker1"></div>
$(function () {
startRefresh();
});
function startRefresh() {
setTimeout(startRefresh, 10000);
var turl = 'https://bter.com/api/1/ticker/doge_btc';
$.getJSON('http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20json%20where%20url%3D%22' + encodeURIComponent(turl) + '%22&format=json', function (data) {
jQuery('#ticker1').html(data['query'].results.json.last);
jQuery('#ticker1').append(' DogeCoin');
});
}
//blah ignore after
<button id="buttonYouWantToClick">Button</button>
<div id="result"></div>
</section>
</div>
</body>
</html>
【问题讨论】:
标签: jquery windows sdk microsoft-metro