So, besides the XML approach (which sounds VERY interesting), there are two methods suggested.  I've done both myself, and personally prefer the IFrames.


The first method would be something like so:


<script src=""> <script>
   x = js_string_set_in_pageB.cfm;
</script>


The second would be something like so:
<script>
    var TargetString
    document.getElementById("myIFrame").src = ""> </script>


And Page be would be something like this:


... some CF Code ...
<script>
    window.parent.TargetString = "#Some Value#";
</script>

(Notice the variable is being set in the IFrame itself - this way you don't have to worry about the Asynchronous issues, and can even call functions on the parent page (which you sometimes have to do to make sure the values you are working with stay in the proper memory scope - it's a pain to refer to a variable that was set in a window/iframe that was then closed or changed).


I would recommend one of the above two methods, but would also suggest exploring the XML.


Hope this helps.


Shawn

-----Original Message-----
From: Nikhil Madani [mailto:[EMAIL PROTECTED]
Sent: Friday, March 12, 2004 1:55 PM
To: CF-Talk
Subject: Re: _javascript_: Retrieving Remote HTML

Interesting......can't hurt to try it out! Only drawbacsk seems to be how different browsers handle the IFRAME element.
Thanks Mark.......

(P.S- To others reading this message- I'd still be interested to know if you've got a different take on this issue...(no offense to you Mark))

>Check out IFRAMEs....
>http://www.oreillynet.com/pub/a/_javascript_/2002/02/08/iframe.html
><http://www.oreillynet.com/pub/a/_javascript_/2002/02/08/iframe.html>
>
>I haven't used them yet but it might be just what you're looking for.
>
>    Mark
>
>-----Original Message-----
>From: Nikhil Madani [mailto:[EMAIL PROTECTED]
>Sent: Friday, March 12, 2004 3:36 PM
>To: CF-Talk
>Subject: Re: _javascript_: Retrieving Remote HTML
>
>
>That's definitely possible, but I surely cannot do an <script
>src="" from within a _javascript_ function....is there
>a way I could assign the js variable (created on page B)to a global scope
>that I can then
>access inside any _javascript_ function on page A?
>
>> One method would be to include Page B with a _javascript_ include
>> (<script src="" and have Page B put the string you're
>> after into a _javascript_ variable.  After the include, your code can
>> see that variable as if it were on the same page.
>
>
>>
>> I'm sure there's more elegant solutions though.
>
>
>  
>> _____  
>>
>  _____
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to