質問

I have a bunch of web pages where I have an identical construct:

<html>
<head>
    <script src="sorttable.js"></script>
    <noscript>
        <meta http-equiv="refresh" content="60">
    </noscript>
    <script type="text/javascript">
        <!--
        var sURL = unescape(window.location.pathname);
        function doLoad()
        { 
            setTimeout( "parent.frames['header_frame'].document.submitform.submit()", 60*1000 ); 
        }
        function refresh()
        { 
            window.location.href = sURL; 
        }
        //-->
    </script>
    <script type="text/javascript">
        <!--
        function refresh()
        { 
            window.location.replace( sURL ); 
        }
        //-->
    </script>
    <script type="text/javascript">
        <!--
        function refresh()
        { 
            window.location.reload( true ); 
        }
        //-->
    </script>
</head>
<body>
    .
    .
    .
    <script type="text/javascript">
        window.onload = function() { sorttable.innerSortFunction.apply(document.getElementById("OpenFace-2"), []); doLoad(); }
    </script>
</body>
</html>

This works perfectly in every page except for one, where when the onload function runs it cannot find the sorttable code (which is loaded from sorttable.js up at the top). All these pages are part of the same application and are all in the same dir along with the js file. I do no get any errors in the apache log or the js console until that page loads, when I get:

sorttable.innerSortFunction is undefined

I can't see what makes this one page different. Can anyone see what is wrong here, or give me some pointers on how I can debug this further?

The code I pasted in is from the source of the page where it does not work, but it is identical as the pages where it does work.

役に立ちましたか?

解決

Looks like on that page the table with id OpenPhace-2 by which you try to sort have no needed class: sortable

The function innerSortFunction of sorttable object will be present only if there is any table with sortable class exists.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top