启动AJAX调试

1.javascript: alert(frames[4].location);2.javascript: alert(frames[4]._debugResponse = true);

<div class="post-text" itemprop="text"> <p>Im trying to setup, an ajax autocomplete , but its unable to fire don't know what im really doing wrong, please take a look at my code, this is my whole script by the way the autocomple function is at the bottom.</p> <pre><code><script type="text/javascript"> $(function(){ $('#type').change(function(){ $.ajax({ url: '<?php echo $this->baseUrl()?>/admin/ajax/add-form/type/' + encodeURIComponent($('#type').val()), dataType: 'json', success: function(data) { $("#more").html(data.form); if ($('#type').val() == 'monthly') { yearchange(); } if ($('#type').val() == 'quarterly') { quarterlyyearchange(); } } }); }); }); function yearchange() { $('#year').change(function(){ $.ajax({ url: '<?php echo $this->baseUrl()?>/admin/ajax/excel-monthly/year/' + encodeURIComponent($('#year').val()), dataType: 'json', success: function(data) { $("#more").html(data.form); yearchange(); } }); }); } function quarterlyyearchange() { $('#quarterlyyear').change(function(){ $.ajax({ url: '<?php echo $this->baseUrl()?>/admin/ajax/excel-quarterly/year/' + encodeURIComponent($('#quarterlyyear').val()), dataType: 'json', success: function(data) { $("#more").html(data.form); quarterlyyearchange(); } }); }); } function sicchange() { $('#search').change(function(){ $.ajax({ url: '<?php echo $this->baseUrl()?>/admin/ajax/excel-sic/search/' + encodeURIComponent($('#quarterlyyear').val()), dataType: 'json', success: function(data) { $("#more").html(data.form); sicchange(); } }); }); } /*********************************Add Autocomplete*******************************************/ function addac() { $( "#search" ).autocomplete({ minLength: 2, dataType: 'JSON', source: function(request, response) { $.ajax({ url: '<?php echo $this->baseUrl()?>/admin/ajax/ac-sic/phrase/' + request.term, dataType: 'json', success: function(data) { response(data); } }) } }); } </script> </code></pre> </div>
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页