Bug 55005 - JavaScript menu doesn't work
Summary: JavaScript menu doesn't work
Status: RESOLVED DUPLICATE of bug 70326
Alias: None
Product: konqueror
Classification: Applications
Component: kjs (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-22 05:16 UTC by unix
Modified: 2004-11-07 22:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description unix 2003-02-22 05:16:17 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.2.1 
OS:          Linux

Navigation at Cisco's on line academy does not work. Error from Konqueror is:

KJS: Failed function call attempt on:  : Object (0x81ab988), line 2
khtml (jscript): WARNING: Script threw exception: TypeError: Expression does not allow calls.

I would provide a link but a password is required to view the page so here is the source of the navigation frame:

<html>
    <head>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>
        </title>
        <script language="JavaScript">
        <!--
            var pageLoaded = false;
            var current = '';
            groupCount = 47;
            var groupOIDs = new Array(47);


        
    groupOIDs[0] = "knet-v214aG144149";

    groupOIDs[1] = "knet-v214aG144209";

    groupOIDs[2] = "knet-v214aG144210";

    groupOIDs[3] = "knet-v214aG144211";

    groupOIDs[4] = "knet-v214aG144212";

    groupOIDs[5] = "knet-v214aG144213";

    groupOIDs[6] = "knet-v214aG144216";

    groupOIDs[7] = "knet-v214aG144217";

    groupOIDs[8] = "knet-v214aG144218";

    groupOIDs[9] = "knet-v214aG144219";

    groupOIDs[10] = "knet-v214aG144225";

    groupOIDs[11] = "knet-v214aG144226";

    groupOIDs[12] = "knet-v214aG144227";

    groupOIDs[13] = "knet-v214aG144228";

    groupOIDs[14] = "knet-v214aG144229";

    groupOIDs[15] = "knet-v214aG144230";

    groupOIDs[16] = "knet-v214aG144231";

    groupOIDs[17] = "knet-v214aG144235";

    groupOIDs[18] = "knet-v214aG144236";

    groupOIDs[19] = "knet-v214aG144237";

    groupOIDs[20] = "knet-v214aG144238";

    groupOIDs[21] = "knet-v214aG144239";

    groupOIDs[22] = "knet-v214aG144240";

    groupOIDs[23] = "knet-v214aG144241";

    groupOIDs[24] = "knet-v214aG144242";

    groupOIDs[25] = "knet-v214aG144243";

    groupOIDs[26] = "knet-v214aG144245";

    groupOIDs[27] = "knet-v214aG144249";

    groupOIDs[28] = "knet-v214aG144250";

    groupOIDs[29] = "knet-v214aG144451";

    groupOIDs[30] = "knet-v214aG144452";

    groupOIDs[31] = "knet-v214aG144453";

    groupOIDs[32] = "knet-v214aG144454";

    groupOIDs[33] = "knet-v214aG144455";

    groupOIDs[34] = "knet-v214aG144456";

    groupOIDs[35] = "knet-v214aG144457";

    groupOIDs[36] = "knet-v214aG144458";

    groupOIDs[37] = "knet-v214aG144459";

    groupOIDs[38] = "knet-v214aG144460";

    groupOIDs[39] = "knet-v214aG144461";

    groupOIDs[40] = "knet-v214aG144462";

    groupOIDs[41] = "knet-v214aG144463";

    groupOIDs[42] = "knet-v214aG144464";

    groupOIDs[43] = "knet-v214aG144465";

    groupOIDs[44] = "knet-v214aG144466";

    groupOIDs[45] = "knet-v214aG144467";

    groupOIDs[46] = "knet-v214aG144246";



            image1off = new Image();
            image1off.src = "../../images/ccna/common/b1up.gif";
            image1on = new Image();
            image1on.src = "../../images/ccna/common/b1ov.gif";

            imagePFoff = new Image();
            imagePFoff.src = "../../images/ccna/common/bPFup.gif";
            imagePFon = new Image();
            imagePFon.src = "../../images/ccna/common/bPFov.gif";

            image2off = new Image();
            image2off.src = "../../images/ccna/common/b2up.gif";
            image2on = new Image();
            image2on.src = "../../images/ccna/common/b2ov.gif";

            image3off = new Image();
            image3off.src = "../../images/ccna/common/b3up.gif";
            image3on = new Image();
            image3on.src = "../../images/ccna/common/b3ov.gif";

            
            image4off = new Image();
            image4off.src = "../../images/ccna/common/b4up.gif";
            image4on = new Image();
            image4on.src = "../../images/ccna/common/b4ov.gif";
            

            image5dim = new Image();
            image5dim.src = "../../images/ccna/common/b5dim.gif";
            image5off = new Image();
            image5off.src = "../../images/ccna/common/b5up.gif";
            image5on = new Image();
            image5on.src = "../../images/ccna/common/b5ov.gif";

            image6dim = new Image();
            image6dim.src = "../../images/ccna/common/b6dim.gif";
            image6off = new Image();
            image6off.src = "../../images/ccna/common/b6up.gif";
            image6on = new Image();
            image6on.src = "../../images/ccna/common/b6ov.gif";



            


            function pageInit() {

                var storedContentID = "";
                                        // must use the toString() method
                                        // on the top.currentPage due to some
                                        // weird string reference issues with
                                        // the IE browser. If toString is not
                                        // used, at unexpected times you will
                                        // get a js error that says something
                                        // like "Unexpected call to method or
                                        // property."
                var currentPage = top.currentPage.toString();
                if (currentPage != "") {
                    storedContentID = currentPage;
                    // Do a loop through the groupOIDs array to find the index.
                    for (i=0; i < groupOIDs.length; i++) {
                        if (groupOIDs[i] == storedContentID) {
                            current = i + 1;
                        }
                    }
                }
                else {
                    current = 1;
                    storedContentID = groupOIDs[current-1];
                }

                top.currentChapter = "knet-v214aCH47505";

                if (groupCount <= 1) {
                    document['image6'].src = image6dim.src;
                    document['image5'].src = image5dim.src;
                }
                else if (current == groupCount) {
                    document['image6'].src = image6dim.src;
                    document['image5'].src = image5off.src;
                }
                else if (current == 1) {
                    document['image5'].src = image5dim.src;
                    document['image6'].src = image6off.src;
                }
                else {
                    document['image5'].src = image5off.src;
                    document['image6'].src = image6off.src;
                }

                if (top.topName == 'feedbackframeset')
                {
                    document['image2'].src = imagePFoff.src;
                    //rioID = top.getGroupParent(storedContentID);
                    //top.pfTree.expandPath(top.pfTree.getOrdering(rioID));
                }

            }


            function changeImages()
            {
                if (document.images && groupCount > 1)
                {
                    for (var i=0; i < changeImages.arguments.length; i+=2)
                    {
                        imageName = changeImages.arguments[i];
                        imageID = changeImages.arguments[i+1];

                        if (imageName == 'image6' &&
                            current == groupCount)
                        {
                            return;
                        }
                        else if (imageName == 'image5' &&
                                 current == 1)
                        {
                            return;
                        }
                        else if (imageName == 'image2' &&
                                 top.topName == 'feedbackframeset')
                        {
                            document[imageName].src = eval("imagePF"+imageID + ".src");
                        }
                        else
                        {
                            document[imageName].src = eval(imageName+imageID + ".src");
                        }
                    }
                }
            }


    function ChangeContent(newContentID) {
        //alert("ChangeContent::top.currentPage (before) = "+ top.currentPage);
        top.currentPage = newContentID;
        //alert("ChangeContent::top.currentPage (after) = "+ top.currentPage);
     
        dash = newContentID.indexOf('-');
        sub1 = newContentID.substring(0,dash);
        sub2 = newContentID.substring(dash+1);

        newContentRef = "../../"+ sub1 +"/"+ sub2 +"/";
        eval('parent.frames.content_frame.location.href="'+newContentRef+'content.html"');
        eval('parent.frames.media_frame.location.href="'+newContentRef+'media.html"');

    }

    function launchReview(reviewID) {
        top.currentSupport = 0;

        dash = reviewID.indexOf('-');
        sub1 = reviewID.substring(0,dash);
        sub2 = reviewID.substring(dash+1);

        ContentRef = "../../"+ sub1 +"/"+ sub2 +"/";

        //alert(ContentRef);
        eval('parent.frames.content_frame.location.href="'+ContentRef+'content.html"');
        eval('parent.frames.media_frame.location.href="'+ContentRef+'media.html"');
        eval('parent.frames.navigation_frame.location.href="'+ContentRef+'reviewnav.html"');

        //added for navigating between Quiz and Review and back to regular Chapter pages
        top.currentSupport++;
        top.firstSupportPage = reviewID;
        top.prevPage = reviewID;
        top.contentResourceID = '';
    }

    function launchQuiz(quizID) {
        top.currentSupport = 0;

        dash = quizID.indexOf('-');
        sub1 = quizID.substring(0,dash);
        sub2 = quizID.substring(dash+1);

        ContentRef = "../../"+ sub1 +"/"+ sub2 +"/";

        //alert(ContentRef);
        eval('parent.frames.content_frame.location.href="'+ContentRef+'content.html"');
        eval('parent.frames.media_frame.location.href="'+ContentRef+'media.html"');
        eval('parent.frames.navigation_frame.location.href="'+ContentRef+'quiznav.html"');

        //added for navigating between Quiz and Review and back to regular Chapter pages
        top.currentSupport++;
        top.firstSupportPage = quizID;
        top.prevPage = quizID;
        top.contentResourceID = '';
    }

    function NextPage(pageNumber) {
        oldChap     = current;

        if (groupCount > 1) {
            if (current == groupCount) {
                return;
            }
            else if ((current + 1) == groupCount) {
                document['image6'].src = image6dim.src;
            }
            else {
                document['image5'].src = image5off.src;
            }

            current++;
            newContentID = new String(groupOIDs[current-1]);
            ChangeContent(newContentID);

            if (top.topName == 'feedbackframeset')
            {
                treeArrayId = top.getTreeId(newContentID);
                top.pfTree.redisplay(treeArrayId,"content");
            }
        }
    }


    function PrevPage(pageNumber) {
        oldChap     = current;

        if (groupCount > 1) {
            if (current == 1) {
                return;
            }
            else if (current == 2) {
                document['image5'].src = image5dim.src;

            }
            else if ((current - 1) < groupCount){
                document['image6'].src = image6off.src;
            }

            current--;
            newContentID = new String(groupOIDs[current-1]);
            ChangeContent(newContentID);

            if (top.topName == 'feedbackframeset')
            {
                treeArrayId = top.getTreeId(newContentID);
                top.pfTree.redisplay(treeArrayId,"content");
            }
        }

    }


    function loadIndex() {
        if (top.topName == 'feedbackframeset')
        {
            top.pfTree.openTreeToView();
        }
        else
        {
            url = "../../knet/v214aCH47505/indexframeset.html";
            popup = window.open(url,"IndexWin","scrollbars=yes,width=550,height=600,top=70,left=120,resizable=yes");
        }
    }


    function loadGlossary() {
        url = "../../knet/v214aCH47505/indexframesetglos.html";
        popup = window.open(url,"IndexWin","scrollbars=yes,width=550,height=600,top=70,left=120,resizable=yes");
    }


        //-->

        </script>
        <base target="_self">
    </head>
    <body onLoad="pageInit();" leftmargin="1" topmargin="1" bgcolor="#000000">
        <table cellpadding="0" cellspacing="0" border="0" height="100%" width="100%">
            <tr>
                <td>
                    <div align="center">
                        <table bgcolor="#000000" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td align="center" valign="top"><a href="javascript:launchReview('knet-v214aG144148');" onMouseOver="changeImages('image1', 'on')" onMouseOut="changeImages('image1', 'off')"><img border="0" name="image1" src="../../images/ccna/common/b1up.gif"></a></td><td align="center" valign="top"><a href="javascript:loadIndex();" onMouseOver="changeImages('image2', 'on')" onMouseOut="changeImages('image2', 'off')"><img border="0" name="image2" src="../../images/ccna/common/b2up.gif"></a></td><td align="center" valign="top"><a href="javascript:launchQuiz('knet-v214aG144469');" onMouseOver="changeImages('image3', 'on')" onMouseOut="changeImages('image3', 'off')"><img border="0" name="image3" src="../../images/ccna/common/b3up.gif"></a></td><td align="center" valign="top"><a href="javascript:loadGlossary();" onMouseOver="changeImages('image4', 'on')" onMouseOut="changeImages('image4', 'off')"><img border="0" name="image4" src="../../images/ccna/common/b4up.gif"></a></td><td align="center" valign="top"><a href="javascript:PrevPage();" onMouseOver="changeImages('image5', 'on')" onMouseOut="changeImages('image5', 'off')"><img border="0" name="image5" src="../../images/ccna/common/b5up.gif"></a></td><td align="center" valign="top"><a href="javascript:NextPage();" onMouseOver="changeImages('image6', 'on')" onMouseOut="changeImages('image6', 'off')"><img border="0" name="image6" src="../../images/ccna/common/b6up.gif"></a></td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
        </table>
    </body>
</html>
Comment 1 Sashmit Bhaduri 2003-11-22 05:44:46 UTC
Please attach the testcase and simplify it if you can (remove piece by piece verifying it still doesn't work)
Comment 2 Stephan Kulow 2004-11-07 22:27:35 UTC

*** This bug has been marked as a duplicate of 70326 ***