问题描述
我将使用此链接 http://m.smo.uhi. ac.uk/en/colaiste/smo40/来说明问题.
I will use this link http://m.smo.uhi.ac.uk/en/colaiste/smo40/ to illustrate the problem.
如果我直接转到此链接,它将显示空白页.浏览器可以正确获取HTML(查看源代码),但是jQM不会在对其进行处理后将其加载到其中-只是插入一个空字符作为子元素(检查元素).
If I go to this link directly, it displays a blank page. The browser gets the HTML correctly (view source), but jQM does not load it into the after it processes it - it just inserts an empty as a child (inspect element).
如果我通过首页 http://m.smo.uhi转到此链接.ac.uk/zh/->单击学院"->单击"SMO @ 40"-页面正确显示.
If I go to this link though the home page http://m.smo.uhi.ac.uk/en/ -> click The College -> click SMO@40 - the page displays correctly.
验证程序未返回任何相关错误,并且该页面与jquerymobile.com/demos/1.2.0/docs/pages/page-anatomy.html上的信息相比,似乎是有效的jQM页面.我在控制台中没有看到错误.
The validator returns no relevant errors, and the page seems to be valid jQM page comparing it to the information on jquerymobile.com/demos/1.2.0/docs/pages/page-anatomy.htmlI get no errors in the console.
我尝试了不同版本的jQuery,但没有区别.我的猜测是,这真的很简单,因为我是jQM的新手.
I have tried different version of jQuery but it makes no difference. My guess is that is it something really simple, since I am new to jQM.
有人可以发现直接链接时为什么页面无法加载吗?
Can anyone spot why the page is not loading when linked directly?
推荐答案
如果仔细观察,您会发现直接链接尚未打开BODY标签.如果添加它,您的页面将成功显示.
If you watch carefully you will notice your direct link don't have opened BODY tag. If you add it your page will be shown successfully.
jQuery Mobile也仅使用页面内容(其逻辑将忽略缺少的BODY标签),因此从内部jQM页面链接时不会造成问题.
Also jQuery Mobile is using only a page content (its logic will disregard missing BODY tag) so this will not cause a problem when linked from internal jQM page.
这篇关于跟随直接链接时,jQuery Mobile页面为空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!