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>
<script><br>
<br>
function setYellowContentBg() {<br>
//thisDFrame represents the current DFrame object.<br>
//Method of dFrameAPI can be run on it:<br>
thisDFrame.setContentBgColor('yellow')<br>
}<br>
<br>
</script>
</BODY>