Uncaught TypeError: Cannot read property 'arrayToDataTable' undefined

Ich bin mit diesem Fehler weiß nicht warum dieser Fehler kommt. Ich bin mit codeigniter und das ist jquery-Fehler.

Dies ist mein anzeigen Seite

<script>
$(function() {
    $("#accordion").accordion({
        collapsible: true,
        heightStyle: "content"
    });
});

var data = google.visualization.arrayToDataTable([
    ['Attendance Type', 'Count'],
    ['Present', <?php echo $student_attendance_count['present']; ?>],
    ['Absent', <?php echo $student_attendance_count['absent']; ?>],
    ['On Leave', <?php echo $student_attendance_count['leave']; ?>],
    ['Attendance Not Maked', <?php echo $attendance_not_marked; ?>]
]);

var options = {
    title: 'My Daily Activities'
};

var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
</script>

Dies ist meine HTML-Seite check this Referenz. Wenn Sie weitere details benötigen, werde ich hier hinzufügen. Ich weiß nicht, wie dieser Fehler kommt.

<div id="accordion">
<h3><span class="accordion_header">Student Strength</span></h3>
<div>
    <table>
        <tr>
            <td>
                <div id="chart_div" style="width: 500px; height: 300px;"></div>
            </td>
            <td style="vertical-align: top">
                <table class="list">
                    <tr>
                        <td style="width: 200px;"><b>Total student</b></td>
                        <td style="width: 50px;" class="text-right"><?php echo $total_student_count; ?></td>
                    </tr>
                    <tr>
                        <td class="attendance_color_present"><b>Present</b></td>
                        <td class="text-right attendance_color_present"><?php echo $student_attendance_count['present']; ?></td>
                    </tr>
                    <tr>
                        <td class="attendance_color_absent"><b>Absent</b></td>
                        <td class="text-right attendance_color_absent"><?php echo $student_attendance_count['absent']; ?></td>
                    </tr>
                    <tr>
                        <td class="attendance_color_leave"><b>Leave</b></td>
                        <td class="text-right attendance_color_leave"><?php echo $student_attendance_count['leave']; ?></td>
                    </tr>
                    <tr>
                        <td><b>Attendance Not Marked</b></td>
                        <td class="text-right"><?php echo $attendance_not_marked =  $total_student_count - ($student_attendance_count['present'] + $student_attendance_count['absent'] + $student_attendance_count['leave']); ?></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>

</div>

<h3><span class="accordion_header">Attendance Details</span></h3>
<div>
    <div class="data_listing" style="margin-left: auto">
        <table class="list"  align="center" style="margin: 0px auto; width: 70%">
            <thead>
                <tr>
                    <th style="width: 10%; text-align:center">Sr. No.</th>
                    <th style="width: 60%">Class Name</th>
                    <th style="width: 30%; text-align: center">Attendance Status</th>
                </tr>
            </thead>
            <?php
            $i = 1;
            $attendance_marked = 0;
            foreach ($class_section_attendance as $class) {
                if ($class['attendance_marked'] == 1) {
                    $image = '<img src ="' . base_url() . 'resources/images/icons/tick_circle.png" title="Attendance Marked" alt="Attendance Marked"/>';
                    $attendance_marked++;
                } else {
                    $image = '<img src ="' . base_url() . 'resources/images/icons/cross.png" title="Attendance Not Marked" alt="Attendance Not Marked"/>';
                }
                echo '<tr>';
                echo '<td style="text-align:center">' . $i++ . '</td>';
                echo '<td>' . $class['name'] . '</td>';
                echo '<td style="text-align:center">' . $image . '</td>';
                echo '</tr>';
            }
            $not_marked = count($class_section_attendance) - $attendance_marked;
            echo '<tr><td colspan="3" style="text-align:center">Total Classes : <b>' . count($class_section_attendance) . '</b> | Attendaced Marked : <b>' . $attendance_marked . '</b> | Not Marked : <b>' . $not_marked . '</b> </td></tr>';
            ?>
        </table>
    </div>
</div>

</div>

Bitte helfen Sie mir.

  • Die Zeilen anzuzeigen, dass das laden der Google Charts-Bibliothek, bitte.
  • Sie können Ihren code im document-ready block, Tat Sie es versuchen?
  • juhana Es ist bereits enthalten in der header-Dateien->controller
  • nicht sehen können.
  • Antti haapala@ Was Sie nicht sehen können. alle die jquery-lib enthalten ist in der header-Datei und ich fordere, dass die header-Dateien im Controller des codeigniter
  • Zeigen Sie Ihre header-Dateien->controller. Es gibt eine gute chance, dass Sie noch nicht geladene Google Charts korrekt, was das problem verursacht, aber es ist unmöglich, sicher zu sagen, ohne zu sehen, wie Sie es tun. Sie müssen die Last der Visualisierung Bibliothek getrennt, machst du das?
  • Ok, ich versuche zu zählen lib Datei getrennt in den Blick. @Juhana
  • Wird Sie mir die lib url um Sie hier zu zitieren. @Juhana
  • TypeError: undefined ist nicht eine Funktion" das kommt jetzt

InformationsquelleAutor Vaibhav Dass | 2014-05-28
Schreibe einen Kommentar