The following code works with latest Firefox and Chrome. But IE 8 generates a javascript error in dhtmlxlayout. IE 10 works just fine. Here’s the code:
[code]
html, body {
width: 100%;
height: 100%;
margin: 0px;
overflow: hidden;
}
var main_layout = new dhtmlXLayoutObject( document.body, '2E' );
main_layout._minHeight = 25;
var i_menuFrame = main_layout.cells('a'); // define top half frame
i_menuFrame.setHeight('25');
i_menuFrame.hideHeader();
i_menuFrame.attachURL('menuTop.php');
i_menuFrame.getFrame().id = "topmenu"; // assign an ID to frame A
document.getElementById('topmenu').scrolling = 'no';
document.getElementsByTagName("table")[0].deleteRow(1); // delete between A and B
//var divs = document.getElementsByTagName('div');
// divs[30].style.backgroundColor = '#ff0000';
//var xx = document.getElementsByTagName("table")[2];
//xx.style.border = '7em solid red';
var layout_2 = main_layout.cells('b'); // define bottom half frame
var layout_3 = layout_2.attachLayout('2U'); // split bottom half into two
var i_vertMenu = layout_3.cells('a'); // vert menu frame
i_vertMenu.setText('Navigator');
i_vertMenu.setWidth('250');
i_vertMenu.fixSize(1,0);
i_vertMenu.attachURL('menuVert.php');
var i_content = layout_3.cells('b'); // main contents frame
i_content.hideHeader();
i_content.attachURL('menu.php');
var i_contentFrame = i_content.getFrame();
i_contentFrame.className = "iframeA";
// Load content into main area
function loadContent (ppage)
{
i_contentFrame.src = ppage;
return false;
}
// Return pointer to content area
function contentFramePtr ()
{
return window.frames[2];
}
// Load content into menu areas
function loadMenuFrame (ppage,frameID)
{
var mf = 0;
if ( frameID == 'menuframe2' ) mf = 1;
window.frames[0].frames[mf].location.href = ppage;
}
[/code]
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.3; .NET4.0C; .NET4.0E)
Timestamp: Fri, 28 Jun 2013 19:28:18 UTC
Message: Object required
Line: 9
Char: 178
Code: 0
URI: [xyz.com/abc/dhtmlxLayout/codebas ... xlayout.js](http://xyz.com/abc/dhtmlxLayout/codebase/dhtmlxlayout.js)
Thank you,
John
Darya
July 1, 2013, 2:20pm
#2
What dhtmlx version do you have and how to reproduce the issue?
Sorry for the delay in responding. I have version 3.6. I simply used IE 8 to run the code I provided above and get the error.
I’m getting the object required error on this line:
document.body.childNodes.length>0?document.body.insertBefore(a,document.body.childNodes[0]):document.body.appendChild(a);
I just noticed the code I originally was not complete. Here is the code that generates the error:
[code]
html, body {
width: 100%;
height: 100%;
margin: 0px;
overflow: hidden;
}
[/code]
OK, I figured it out. I was missing the tag in the html file. Seems that newer browsers automatically set one where IE8 doesn’t.
Thank you.
John