0

I am using visual basic, javascript, and html.

I am trying to use google hierarchy chart api. I works fine on localhost but when I try to move the same code to the server than I get the following error:

Error: Object doesn't support this action

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="myFile.aspx.vb" Inherits="UI_myFile" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script>
        google.charts.load('current', { packages: ["orgchart"] });
        google.charts.setOnLoadCallback(drawChart);

        function getQueryVariable(variable) {
            var query = window.location.search.substring(1);
            var vars = query.split("&");
            for (var i = 0; i < vars.length; i++) {
                var pair = vars[i].split("=");
                if (pair[0] == variable) {
                    return pair[1];
                }
            }
        }

        function drawChart() {
            var data = new google.visualization.DataTable();
            data.addColumn('string', 'Name');
            data.addColumn('string', 'Title');

            if (getQueryVariable("urlVar") == "test") {
                data.addRows([
                [{ v: 'test1', f: 'test1<div>test1</div>' }, ''],
                [{ v: 'test2', f: 'test2<div>test2</div>' }, 'test1']

                ]);
            }
            var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));
            chart.draw(data, { allowHtml: true });
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div id="chart_div"></div>
    </form>
</body>
</html>
1
Contributor
1
Reply
11
Views
11 Months
Discussion Span
Last Post by Link_1
0

was able to fix the issue by

<meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1">

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.