thisDFrame.html

<HTML>

<HEAD>

<script>var dFrameFilePath = '../../../../../dFrame/'</script>

<script language="Javascript" src="../../../../../dFrame/dFrame/lib/DFrameAPI.js"></script>

 

<script language="Javascript">          

     //Style

     DFrameAPI.include('dFrame/styles/blue/styleBlue.js')

 

     DFrameAPI.onLoad = function(){   

          //Instanciate the first dFrame

          var baseAll = new DFrame([0, 0, 100, 100], 'thisDFrame.html', dFrameStyle);

          var txt = 'The first Button uses the \'thisDFrame\' keyword to apply a method on the DFrame containing the Button.'

          txt += '<br>The second Button uses the \'thisDFrame.window\' keywords to access the Javascript code stored in the page.'

          txt += '<br>This code will use the \'thisDFrame\' keyword to get a handle to the DFrame containing the page from inside the page.'

          baseAll.addText([3,3],txt )

 

          dFrame = new DFrame([20, 20, 80, 80], 'page.html', dFrameStyle, baseAll);

          //Use the 'thisDFrame' keyword. Here apply to DFrame dFrame

          dFrame.addButton('thisDFrame.setContentBgColor(\'blue\')', 'thisDFrame.setContentBgColor("blue")')                     

          //Call the setYellowContentBg function stored in page.html: Use window 'keyword'

          dFrame.addButton('call setYellowContentBg function', 'thisDFrame.window.setYellowContentBg()')

 

          dFrame.setURL('./dFrameAccess/page.html')

     }

</script>

</HEAD>

</HTML>

page.html

<HTML>

<HEAD>

<script> 

     function setYellowContentBg() {

          //thisDFrame represents the current DFrame object.

          //Method of dFrameAPI can be run on it:

          thisDFrame.setContentBgColor('yellow')

     }

</script>

</HEAD>

<BODY>

&lt;script&gt;<br>

<br>

&nbsp;&nbsp;&nbsp;function setYellowContentBg() {<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//thisDFrame represents the current DFrame object.<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Method of dFrameAPI can be run on it:<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;thisDFrame.setContentBgColor('yellow')<br>

&nbsp;&nbsp;&nbsp;}<br>

<br>

&lt/script&gt

</BODY>