You can't put CF and ASP on the same page, unfortunately.  In CF, you can do
a detection for Java/JS as shown below, and redirect the user accordingly.
As long as the java is an applet loaded client side, you're fine, you can
just call it as you normally would.  In order to get information, though,
from the java applet or the wddx recordset to the CF Server, you'll need to
do an HTTP request, either appending it to the URL querystring(HTTP GET), or
using either a form on the page(in the case of javascript), or methods in
Java(HTTP POST).  With Javascript, you'll want to reserialize your recordset
and drop it in a hidden form field before submitting. 

<cfif not isDefined('session.reloads')>
        <cfset session.reloads=0>
</cfif>
<cfif isDefined('url.java')>
        <cfset session.java=url.java>
        <cfset session.reloads=session.reloads+1>
</cfif>
<cfif isDefined('url.js')>
        <cfset session.js=url.js>
        <cfset session.reloads=session.reloads+1>
</cfif>
<cfif isDefined('url.reload')>
        <cfset session.reloads=session.reloads+1>
        <cfif not isDefined('session.java')>
                <cfset session.java=0>
        </cfif>
        <cfif not isDefined('session.js')>
                <cfset session.js=0>
        </cfif>
        Point the browser to the scriptless site. 
</cfif>
<meta http-equiv="Refresh" content="3, thispage.cfm?reload=true">
<cfif not isDefined(session.java)>
        Use java client side to tell the browser to call this same page
        href='thispage.cfm?java=1';
</cfif>
<cfif not isDefined('session.js')>
        <script>
                location.href="thispage.cfm?js=1";
        </script>
</cfif>
That way, you get 3 blinky reloads and you have all the info you need to
move the user to the correct portion/format of your site.  
-----Original Message-----
From: Evan Lavidor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 18, 2000 12:02 PM
To: CF-Talk
Subject: RE: Variables in Java and Javascript


Don't know about Java, but this can't be done with JavaScript.  CF is server
side, and JavaScript is client side.  By the time the JavaScript executes,
CF has completed all of its execution.  There are tags that check to see if
JavaScript is enabled, check out CF_aBrowserInfo.  Haven't used it yet, but
just saw it in the tag gallery yesterday.

http://devex.allaire.com/developer/gallery/info.cfm?ID=5FE4539E-504A-11D4-AA
A000508B94F380&method=Full

Evan

> -----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/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
> or send a message with 'unsubscribe' in the body to
> [EMAIL PROTECTED]

----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
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