newMainPageDFrame.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')

//global var to stop recursive creation

var count

//global array for bgColors

var colors = ['blue', 'green', 'yellow', 'red']

DFrameAPI.onLoad = function(){

//Set a bgColor for background

DFrameAPI.setBackgroundColor('silver')

//Create the base DFrame

baseAll = new DFrame([10, 10, 90, 90], 'newMainPageDFrame.html', dFrameStyle);

var bar = baseAll.addBar()

bar.addButton('Create new DFrame', 'newDFrame()')

var txt = bar.addText(null, 'Simple sample:<br>- The Create new DFrame Button calls the newDFrame function.<br>- The newDFrame function creates a new DFrame with page.html inside.<br>- The page.html uses its onLoadDFrame function to call the newDFrame function...')

txt.setBordersWidth(0)

txt.setBgNormal('')

baseAll.show()

}

function newDFrame(url) {

count = 0

dFrame = new DFrame([10, 10, 90, 90], 'page.html', dFrameStyle, baseAll)

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

}

</script>

</HEAD>

</HTML>

page.html

<HTML>

<HEAD>

<script>

function onLoadDFrame() {

mainPage.dFrameStyle.setContentBgColor(mainPage.colors[mainPage.count])

dFrame = new mainPage.DFrame([10, 10, 90, 90], 'page.html', mainPage.dFrameStyle, thisDFrame)

if (mainPage.count < 3) {

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

mainPage.count += 1

}

}

</script>

</HEAD>

<BODY>

Text on page.html<br>

</BODY>