Topic: Runtime-error Microsoft JScript 'window' is not defined Pages that link to <a href="https://ozoneasylum.com/backlink?for=22362" title="Pages that link to Topic: Runtime-error Microsoft JScript &amp;#039;window&amp;#039; is not defined" rel="nofollow" >Topic: Runtime-error Microsoft JScript &#039;window&#039; is not defined\

 
Author Thread
irowake
Obsessive-Compulsive (I) Inmate

From:
Insane since: Jun 2004

IP logged posted posted 06-29-2004 09:29 Edit Quote

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 aFieldsnt;
}
}
}
]]>
</msxsl:script>
<xslaram name="selection" select="me:GetResult()">
</xslaram>
<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?

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

IP logged posted posted 06-29-2004 16:03 Edit Quote

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu