OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
Runtime-error Microsoft JScript 'window' is not defined
This page's ID:
22362
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Hi, I have managed to pass parameters to an xsl-element. The script is as followed: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:me="urn:my-scripts"> <msxsl:script language="javascript" implements-prefix="me"> <![CDATA[ function GetResult() { var szURL = window.location.href; var szFileName = szURL.substring(szURL.lastIndexOf("/") + 1,szURL.indexOf(".xml") + 4); var szSearch = window.location.search; if (szSearch.indexOf("?") == 0) szSearch = szSearch.substring(1); if (szSearch.length != 0) { var aRows = szSearch.split("&"); var aFields; for (var i=0;i<aRows.length;i++) { aFields = aRows[i].split("="); i=arows.length; return aFields[1]; } } } ]]> </msxsl:script> <xsl:param name="selection" select="me:GetResult()"> </xsl:param> <xsl:template match="Code_Penal"> <HTML> <BODY> <H2 align="center"> <FONT color="green"> Search results for "<xsl:value-of select="$selection"/>" </FONT> </H2> <HR/> <xsl:apply-templates select=".//Article[@Mots_cle]"/> </BODY> </HTML> </xsl:template> I added some extra code to the GetResult() function to get the parameters from the URL(only one now) and I got the next error: Runtime-error Microsoft JScript 'window' is not defined line = 4, col = 4 (line is offset from the start of the script ... What can I do to prevent this error?
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »