如何在单独的窗口从一个站点地图打开文档 [英] How to open a document in a separate window from a site map

查看:149
本文介绍了如何在单独的窗口从一个站点地图打开文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在使用Sitemap菜单控件打开一个文档。我使用的网站地图下面code,但得到一个错误。我希望能够点击菜单项,有它在新窗口中打开示例文档,但不要有原来的页面导航到一个新的地方(主要是主做网页上什么都没有。)

I was hoping to open a document in a menu control using a sitemap. I am using the following code in the sitemap but get an error. I would like to be able to click on the menu item, have it open the sample doc in a new window, but not to have the original page navigate to a new place (essentially to do nothing on the main page.)

<siteMapNode url="javascript:window.open('Sample.doc','SampleName'); return false" title="FAQs"  description="FAQs" />

你知道吗?有一些JavaScript,我可以使用,不需要我的每一个页面上注册一个功能?

Any idea? Is there some javascript I can use that does not require me to register a function on every page?

推荐答案

我最终使用下列内容:

<siteMapNode url="javascript:window.open('Sample.doc','SampleName'); void(0);" title="FAQs"  description="FAQs" />

这篇关于如何在单独的窗口从一个站点地图打开文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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