cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew M <and...@jibeya.com>
Subject Re: HowTo pass cocoon variables into client-side javascript?
Date Mon, 22 Nov 2004 11:43:24 GMT
Derek,
maybe you missed my earlier post, but my solution was this:

In jx page (pop-up):

	<java-script>
		<jx:if test="${userGlobal == null}">
		<![CDATA[
			window.opener.document.location.href = "myPage.xml";
			window.close();
		]]>
		</jx:if>
	</java-script>

In xsl template:

	<script language="javascript">
		<xsl:apply-templates select="//java-script"/>
	</script>

There must be a more efficient way to do this!!?

regards

Andrew
On 22 Nov 2004, at 10:13, Derek Hohls wrote:

> Andrew
>
> Maybe you should expand this a bit more; doesn't
> the ASP code you quote run on the server? If
> so, then there are obviously Cocoon equivalents.
> Secondly, the javascript code that runs on the
> client machine can be generated on the server -
> and at generation time (ie. just before the popup
> window is created by the server) the session status
> could be determined and made part of the code.
>
> Just some speculative ideas!!
> Derek
>
>>>> andrew@jibeya.com 2004/11/22 11:55:12 AM >>>
> Hi,
> just to make things more understandable.....
>
> 1. User clicks on a link which opens a pop-up window
> 2. javascript in the pop-up window determines whether the session is
> still current
> 3. If the session has expired, close the pop-up window, and reload the
>
> referrer window
>
> Hence the reason I need to know how to pass cocoon variables into
> client-side javascript, not unless server-side javascript (rhino) is
> now capable of this!! ;-)
>
> regards
>
> Andrew
> On 22 Nov 2004, at 09:03, Andrew M wrote:
>
>> Hi,
>> in ASP I can do:
>>
>> var testSessionState = <%= getSessionState %>
>>
>> How can I achieve the same thing in cocoon?
>>
>>
>> regards
>>
>> Andrew
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> MailScanner thanks transtec Computers for their support.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Mime
View raw message