Bechtle wrote :
> Hi googlers
>
>
> I'm creating a portal on MS Office Portal Server. Unfortunaterly
> there's no way to open a link of the navigation in a new window.
>
>
> Now I'm trying to create a homepage with a webpart which contains a
> forwarding to a homepage. The page has to be opened in a new window.
Has to? Why? What about text browsers, tv browsers, PDA and other
web-aware applications which can not open another instance of the
application?
> Unfortunately I don't know JavaScript, please help me 
>
>
> I found in the internet some solutions, but I can't understand
> everything. At the moment my code looks like that:
>
>
> <html>
First start with a doctype declaration. Since you are going to be using
the target attribute, then you need a transitional DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
Recommended DTDs to use in your Web document.
http://www.w3.org/QA/2002/04/valid-dtd-list.html
> <head><title>Test</title>
> <script type="text/javascript">
> function OpenWin (Adresse) {
> Fenster1 = window.open("http://localhost/asp", "testlink.htm");
> Fenster1.focus();
> }
<script type="text/javascript">
var WindowObjectReference; // global variable
function openRequestedSinglePopup(strUrl, strWindowName)
{
if(WindowObjectReference == null || WindowObjectReference.closed)
{
WindowObjectReference = window.open(strUrl, strWindowName,
"resizable=yes,scrollbars=yes,location=yes,status= yes");
}
else
{
WindowObjectReference.focus();
};
}
</script>
(...)
<p><a href="testlink.htm" target="SingleSecondaryWindowName"
onclick="openRequestedSinglePopup(this.href, this.target); return
false;" title="This link will create a new window or will re-use
an already opened one">Some descriptive words about the linked
resource</a></p>
> </script>
> </head>
> <body>
> <a href="testlink.htm" onclick="OpenWin(this.href); return false">open
> link in new window</a>
> </body>
> </html>
>
> Path of the file is: C:\inetpub\wwwroot\asp\weiterleitung.htm
> localhost is C:\inetpub\wwwroot
>
>
> what's wrong?
You did wrong by having a dot in the windowName (testlink.htm) and you
did not make any use of the function parameter (Adresse)
You can learn more and get more explanations here:
DOM:window.open()
http://developer.mozilla.org/en/docs/DOM:window.open
Gérard
--
remove blah to email me