cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leona Slepetis <LSlepe...@alliancetech.com>
Subject error with Window.open() in Cocoon
Date Wed, 30 Jun 2004 19:17:06 GMT




Hi All,

I have a problem with Cocoon 2.1 that someone may have seen before.

I am trying to launch a window containing a pdf file, using the JavaScript
Window.open() method.

My XSL file has some code that looks like this:
<a href="#">
  <xsl:attribute name="onclick">
    <xsl:text>
pdfWindow("http://www.alliancetech.com/rsduc04/files/daily_20040718.pdf")</
xsl:text>
  </xsl:attribute>
  <img src="/rsduc04/images/welcome/welcome_05.gif" />
</a>

In my sitemap I have:
<map:match type="regexp" pattern="files/daily_20040718.pdf">
  <map:read mime-type="application/pdf" src=
"file://Z:/files/daily_20040718.pdf" />
</map:match>

Finally, here's the JavaScript function:
function pdfWindow( url )
{
var win = window.open(url,"Conference_Navigator",
"menubar=no,directories=no,location=no,toolbar=no,scrollbars=yes,resizable=no,width=845,height=430,left="
+159+",top="+132);
win.focus();
}

When I run this, I get an IE error saying that the site can't be found.
(This also happens when I try it with .doc files and application/msword)

If I call this pipeline directly from my code, like:
<a href="http://www.alliancetech.com/rsduc04/files/daily_20040718.pdf">
  <img src="/rsduc04/images/welcome/welcome_05.gif" />
</a>
It opens the PDF file, but in the same window.

If I use the same pipeline with mime-type="image/gif" and an image file,
the JavaScript code works and opens a new window.

Does anyone know what is happening here? I know that I am getting to the
same place in the sitemap by calling the URL directly or through the open()
function,  It seems that certain mime types are not being handed off to the
new window correctly.

Thanks,
Leona Slepetis


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message