I don't understand this all that well.  I'll say this in my own words and if
this is what you need, I think I have a possible solution.

User scenario:
Johnny Foo clicks on a link that points to http://server/directory/page1.cfm
CF server processes page1.cfm and in the process, creates a JavaScript
variable.
Web server sends resulting page back
Johnny Foo receives a page1.cfm in HTML format, and because it contains
Javascript, it will be executed, computing a variable.
Then...

Scenario 1a
You would like to call http://server/directory/page2.cfm?variable=1 without
Johnny knowing it, and without changing the page.
Solution:  I have a trick to do that.

or

Scenario 1b
You would like to call http://server/directory/page2.cfm?variable=1 and then
have Johnny receive page2.cfm in HTML format.
use
    window.location =
'http://server/directory/page2.cfm?variable='+jsvariable
after you compute jsvariable.  Make sure page1.cfm has no HTML output.  The
user will see a white page for a second.  Or put a nice short message in
page1 that will, at best, flash momentarily.

<Jaime/>


> -----Original Message-----
> From: Gavin Myers [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 18, 2000 9:22 AM
> To: CF-Talk
> Subject: RE: Variables in Java and Javascript
>
>
> What i've been looking into is cfwddx, i think its my only hope:
>
> <cfset javascript_verify = 0>
> <cfwddx action="CFML2WDDX" input="#javascript_verify#" output =
> "javascript_verify_wddx">
> <cfwddx action="WDDX2JS" input="#javascript_verify_wddx#"
> toplevelvariable="javascript_final_verify"
> output="javascript_final_verify">
> <SCRIPT LANGUAGE="JAVASCRIPT">
>   <CFOUTPUT>#javascript_final_verify#</CFOUTPUT>
>
> <!--
> document.write((javascript_final_verify = 1));
>
> document.write((javascript_final_verify));
> //-->
> </SCRIPT>
> <br><Br><br>
> <cfoutput>#javascript_final_verify#</cfoutput>
>
> the problem is I cant carry this number from js back to cf. Any
> suggestions
> on this? Or is it because js is a broswer lang, you cant go back
> to running
> cf again?
>
> By using cfwddx, can i then put java and asp on the same page?
>
>
> -----Original Message-----
> From: Patricia Lee [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 18, 2000 10:33 AM
> To: CF-Talk
> Subject: RE: Variables in Java and Javascript
>
>
> The javascript would work, yes.
>
> The java wouldn't work as you have it because you can only process one
> server side language per application page.  Java and ColdFusion cannot be
> called on the same page.
>
> I do not know if or how you could tell that a broweser is
> java-enabled.  I'd
> wait and see if Watts responds to this... one can always hope.
>
> -Patti
>
> -----Original Message-----
> From: Gavin Myers [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 18, 2000 11:07 AM
> To: CF-Talk
> Subject: Variables in Java and Javascript
>
>
> Hey people,
>
> New thing:
> I need to check if a certing browser has java enabled, and javascript
>
> can you set a variable in java or javascript and let it be read in cold
> fusion?
>
> this is what i'm thinking:
>
> <Cfset javascript = 0>
> <cfset java = 0>
>
> javacode
> put 1 into java
> /javacode
>
> javascript code
> put 1 into javascript
> /javascript code
>
> <cfif javascript = 0>
> no javascript
> </cfif>
> <cfif java = 0>
> no java
> </cfif>
>
> any ideas on how to do this? better then this one? And, if you can cross
> variables through different peices of code, what is the syntax for writing
> this in javascript, java? Can you have Java on a cfm page?

------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to