Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Web Browser not compatible in R2006b

Subject: Web Browser not compatible in R2006b

From: Mifano

Date: 9 Nov, 2007 12:23:06

Message: 1 of 2

Hello,
I have the following HTML code using javascript to create
collapse folders and I test on R2006a and R2006b like
described below:

%% Myfile.html

<html>
<head>
</head>
<body>
<script type="text/javascript">
function Toggle(node)
{
// Unfold the branch if it isn't visible
if (node.nextSibling.style.display == 'none')
{
// Change the image (if there is an image)
if (node.children.length > 0)
{
    if (node.children.item(0).tagName == "IMG")
    {
        node.children.item(0).src = "images/folder_open.png";
    }
}

node.nextSibling.style.display = '';
}
// Collapse the branch if it IS visible
else if (node.nextSibling.style.display == '')
{
// Change the image (if there is an image)
if (node.children.length > 0)
{
    if (node.children.item(0).tagName == "IMG")
    {
        node.children.item(0).src = "images/folder_close.png";
    }
}

node.nextSibling.style.display = 'none';
}

}
</script>


<TABLE cellspacing="5" BORDER=0>
<TR>
<TD>    </TD>
<TD>
<A onClick="Toggle(this);">
    <IMG SRC="images/folder_open.png">Node 1
</A>
<DIV>
<TABLE cellspacing="5" BORDER=0>
    <TR>
    <TD>    </TD>
    <TD>
    <DIV onClick="Toggle(this);">
        <IMG SRC="images/folder_open.png">Node 2
    </DIV>
        <TABLE cellspacing="5" BORDER=0>
            <TR>
                <TD>    </TD>
                <TD>
                    <IMG SRC="images/ModelIcon.png">
                        <font color="blue">Node 3</font>
                                        
                <DIV></DIV>
                </TD>
            </TR>
        </TABLE>
    </TD>
    </TR>
</TABLE>
</DIV>
</TD>
</TR>
</TABLE>
</body>
</html>


I used Web Browser of Matlab to open Myfile.html. This code
works fine in R2006a (folders collpased) but not in R2006b.

Could you tell me what was changed in Web Browser of R2006b?
And how can I have the same effect in R2006b like in R2006a?

Thank you.



 

Subject: Web Browser not compatible in R2006b

From: Christopher Kollett

Date: 9 Nov, 2007 16:02:08

Message: 2 of 2

"Mifano " <nchminh@gmail.com> wrote in message
<fh1jfa$4sv$1@fred.mathworks.com>...
> Hello,
> I have the following HTML code using javascript to create
> collapse folders and I test on R2006a and R2006b like
> described below:
>
[HTML file contents removed]
>
> I used Web Browser of Matlab to open Myfile.html. This code
> works fine in R2006a (folders collpased) but not in R2006b.
>
> Could you tell me what was changed in Web Browser of R2006b?
> And how can I have the same effect in R2006b like in R2006a?
>
> Thank you.

As of R2006b, MATLAB uses a Mozilla-based solution for HTML
rendering on 32-bit Windows platforms. It appears that the
HTML file you posted behaves in the same way in the MATLAB
web browser as it does in Firefox. While I haven't looked
at your JavaScript in too much detail, it appears that the
call to nextSibling is not returning the element that you
are trying to display/hide.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us