简体   繁体   English

桌面网页

[英]Desktop webpage

I have a webpage which has links to documents (MS Word .doc files). 我有一个网页,其中包含文档链接(MS Word .doc文件)。 If you view this webpage on IE8 directly, and click on one of these document links, it opens up a new IE8 window/tab and displays the document directly in IE8 with a limited MS Word tool bar which is perfect. 如果您直接在IE8上查看此网页,并单击其中一个文档链接,它将打开一个新的IE8窗口/选项卡,并使用有限的MS Word工具栏直接在IE8中显示该文档,这是完美的。

If I then change the desktop background to the webpage, if the user then clicks on the same document links above, the documents open directly is MS Word. 如果我然后将桌面背景更改为网页,如果用户然后单击上面的相同文档链接,则直接打开的文档是MS Word。 Why is this happening? 为什么会这样? I need it to continue to open directly in a new IE8 window. 我需要它继续在新的IE8窗口中直接打开。

This is what the HTML link looks like: 这就是HTML链接的样子:

<a href="file:///C:/folder/document1.doc" target="_blank">Document 1</a>

This bit of HTML works perfectly in IE8 directly, but when the web page which contains this link is used via right click desktop in XP > Properties > Desktop > Customize Desktop > Web where the webpage url is added to show the webpage on the desktop, if I then click on the above document1.doc link, it opens in MS Word instead of IE8. 这一点HTML直接在IE8中完美运行,但是当包含此链接的网页通过right click desktop in XP > Properties > Desktop > Customize Desktop > Web ,其中添加了网页URL以在桌面上显示网页,如果我然后单击上面的document1.doc链接,它将在MS Word而不是IE8中打开。

You could indeed try to set the target to _blank , but if this doesn't work, I think i have a solution. 您确实可以尝试将目标设置为_blank ,但如果这不起作用,我想我有一个解决方案。

Create a new html page in the same directory as the one you're running from your desktop. 在与您从桌面运行的目录相同的目录中创建一个新的html页面。

This should be the content: 这应该是内容:

//keep in mind: the javascript code ain't mine, but it works ;). //请记住:javascript代码不是我的,但它有效;)。

<html>
<head>
<script type="text/javascript">
function getQuerystring(key, default_)
{
  if (default_==null) default_=""; 
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
  var qs = regex.exec(window.location.href);
  if(qs == null)
    return default_;
  else
    return qs[1];
}
document.location = getQuerystring('redirect');
</script>
</head>
<body>
you're being redirected
</body>
</html>

On it's own, this file doesn't do anything. 就它本身而言,这个文件没有做任何事情。 But if you change the links on your desktop HTML file to 但是,如果您将桌面HTML文件上的链接更改为

NAME_OF_NEW_FILE_THAT_YOU_JUST_MADE.html?redirect=LINK_THAT_YOU_HAD_BEFORE

it's all a little sketchy, but it works. 它有点粗略,但它的工作原理。 It will open in your browser, because it's HTML. 它将在您的浏览器中打开,因为它是HTML。 And it will open your file as well, thanks to JS 由于JS,它也会打开你的文件

The default behaviour when opening MS Word files in IE8 is to open them in a new tab with the limited toolbar. 在IE8中打开MS Word文件时的默认行为是在带有限工具栏的新选项卡中打开它们。 When you are using the same page as a background on Active Desktop you are no longer using IE8, and therefore it will open directly in MS Word. 当您在Active Desktop上使用相同的页面作为背景时,您不再使用IE8,因此它将直接在MS Word中打开。

So, I dont think there is a way to "embed" the document as a background or to trigger it to open IE8. 所以,我不认为有一种方法可以“嵌入”文档作为背景或触发它来打开IE8。

target = "_blank" would open in a new tab, which I don't think Active Desktop supports. target =“_ blank”将在新选项卡中打开,我不认为Active Desktop支持。 Try target = "_self" 试试target =“_ self”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM