How to open a document in a separate window from a site map

Sean picture Sean · May 6, 2010 · Viewed 7.8k times · Source

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" />

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

Answer

Sean picture Sean · May 6, 2010

I ended up using the following:

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