>when you are working with cf8 ajax ui controls, you should either have
>all your js in an external file, or, if you have js in the same file,
>your js functions must be declared as
>functionname = function(arguments) {
>...
>}
>
>not
>
>function functionname(arguments) {
>...
>}
>
>hth
>
>Azadi Saryev
>Sabai-dee.com
>http://www.sabai-dee.com/
>

Yes. I read about them and have tried them in vain.  Here's the detailed test 
result, please take a look.  Many thanks.

Test Env:
a) IE7 on XP
b) FF2 on XP
Test Outcome: 
Not working; the js in question has not be called

DETAILS:
1. The test cf template in question (it's inside a CFWINDOW) reads
<html>
<head>
<script type="text/javascript" src="/js/TestIframes.js"></script>
</head>

<body>
main page

<form id="nutsFrm" method="post">
<iframe name="out" id="out" src="Untitled1.html" contenteditable="true" 
style="width:300px; height:150px"></iframe><br/>
</form>

<form id="nutsFrm2" method="post">
<iframe name="nuts2" id="nuts2" style="width:300px; height:150px"></iframe><br/>
</form>

<cfset AjaxOnLoad = "init">
</body>
</html>

2. The TestIframes.js reads
init = function() {                     
         alert("hi");   
     // method 1
       var doc = self.frames['out'].document;
       if ('designMode' in doc) {
        self.frames['out'].document.designMode = 'on';
       }
       doc.clear();
       doc.open('text/html','replace');
       doc.write('<html><body>Hello!</body></html>');
       doc.close();
                        
                 // method 2            
                  frames.nuts2.document.designMode = "On";
                        var s2 = "plain text test";
        
      var D2 = frames['nuts2'].document;
      D2.open(); 
      D2.write('<html>' + s2 + '</html>'); 
      D2.close();       
                
  }     

3. Response (by Firebug)

<html>
<head>
<script type="text/javascript" src="/js/TestIframes.js"></script>
</head>

<body>
main page

<form id="nutsFrm" method="post">
<iframe name="out" id="out" src="Untitled1.html" 
contenteditable="true"></iframe><br/>
</form>

<form id="nutsFrm2" method="post">
<iframe name="nuts2" id="nuts2"></iframe><br/>
</form>

</body>
</html>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301854
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to