Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript e首先(使用适当的压痕)并隔离问题。至少回答你的问题比较容易。@ayke格式问题不在于我的实际代码,而在于我无法将其发布到网站上。我的第一次-我的道歉。好的。可能是制表符和空格的问题?建议使用四个空间。meta.stackoverflow.com/编辑帮助_Javascript_Jquery_Ajax - Fatal编程技术网

Javascript e首先(使用适当的压痕)并隔离问题。至少回答你的问题比较容易。@ayke格式问题不在于我的实际代码,而在于我无法将其发布到网站上。我的第一次-我的道歉。好的。可能是制表符和空格的问题?建议使用四个空间。meta.stackoverflow.com/编辑帮助

Javascript e首先(使用适当的压痕)并隔离问题。至少回答你的问题比较容易。@ayke格式问题不在于我的实际代码,而在于我无法将其发布到网站上。我的第一次-我的道歉。好的。可能是制表符和空格的问题?建议使用四个空间。meta.stackoverflow.com/编辑帮助,javascript,jquery,ajax,Javascript,Jquery,Ajax,e首先(使用适当的压痕)并隔离问题。至少回答你的问题比较容易。@ayke格式问题不在于我的实际代码,而在于我无法将其发布到网站上。我的第一次-我的道歉。好的。可能是制表符和空格的问题?建议使用四个空间。meta.stackoverflow.com/编辑帮助#代码谢谢。我很害怕。我将移动代码,并在我的脚本中添加一个ajax调用,这将完成我的目标。谢谢。我很害怕。我将移动代码,并在我的脚本中添加一个ajax调用,这将完成我的目标。 <form style="position:absolute;


e首先(使用适当的压痕)并隔离问题。至少回答你的问题比较容易。@ayke格式问题不在于我的实际代码,而在于我无法将其发布到网站上。我的第一次-我的道歉。好的。可能是制表符和空格的问题?建议使用四个空间。meta.stackoverflow.com/编辑帮助#代码谢谢。我很害怕。我将移动代码,并在我的脚本中添加一个ajax调用,这将完成我的目标。谢谢。我很害怕。我将移动代码,并在我的脚本中添加一个ajax调用,这将完成我的目标。
<form style="position:absolute; top:65px; left:650px">
    Select State to View:
    <select id="myList" onchange="load_state_data(); xml = getStateInfo();">
      <option selected="selected"></option>
        <?php
            foreach($stateNames as $state){
                echo('<option>'.$state.'</option>');
            }
        ?>
    </select>
</form>
function load_state_data() {
    var state_name = $("#myList option:selected").val();
    $.ajax({
        type: 'post',
        url: 'state_data.php',
        dataType: "xml",
        data: {
            state_name: $("#myList option:selected").val()
        },
        success: function (data) {
            //clear out previous values
            for (j = 0; j < 5; j++) {
                $('#top_name_' + j).html("");
                $('#top_score_' + j).html("");
            }

            $(data).find('TOP').each(function (index) {
                $('#top_name_' + index).html($(this).find('COMPANY_NAME').text());
                $('#top_score_' + index).html($(this).find('Q_SCORE').text());
            });

            //initialize my temp arrays for reverse ordering the results
            var botName = new Array();
            var botScore = new Array()

            //clear out previous values
            for (j = 0; j < 5; j++) {
                $('#bot_name_' + j).html("");
                $('#bot_score_' + j).html("");
            }

            $(data).find('BOTTOM').each(function (index) {
                //$('#bot_name_'+index).html($(this).find('COMPANY_NAME').text());
                //$('#bot_score_'+index).html($(this).find('Q_SCORE').text());
                botName[index] = $(this).find("COMPANY_NAME").text();
                botScore[index] = $(this).find("Q_SCORE").text();
                j = index;
            });
            var newOrderName = botName.reverse();
            var newOrderScore = botScore.reverse();
            for (i = 0; i < newOrderName.length; i++) {
                $('#bot_name_' + i).html(newOrderName[i]);
                $('#bot_score_' + i).html(newOrderScore[i]);
            }

            //clear the variables from memory
            delete botName;
            delete botScore;
            delete newOrderName;
            delete newOrderScore;


            //cycle through results and save my locations to an array of the map markers
            var inst_info = new Array();
            $(data).find('INST_MARKER').each(function (index) {
                inst_info[index] = [parseFloat($(this).find('LAT').text()),
                parseFloat($(this).find('LONG').text()),
                $(this).find('COMPANY_NAME').text(), $(this).find('Q_SCORE').text()];
            });

            $(data).find('INST_COUNT').each(function () {
                $('#num_total').html($(this).find('NUM_TOTAL').text());
                $('#num_null').html($(this).find('NUM_NULL').text());
            });
            return (inst_info);
        },
        error: function (data) {
            alert('There was an error. Please try again shortly.');
        }
    });
};
    //clear the variables from memory
    delete ...