weixin_33696106
weixin_33696106
2016-04-04 10:50
采纳率: 0%
浏览 105

使用getJSON时出现404错误

Hi guys having some trouble here trying to reuse some code here giving to by the owner of the web site . I have a load and save function the save function works fine now but not the load , I keep getting a 404 error even tho the file is there i tried renaming the file , clear cache ect .. Any ideas

$('#btnLoad').click(function(evt) {
  //    empty the list
  $('#selCaseStudies').find('option').remove();

  //    populate the list of case studies
  $.getJSON("dbs/gcsl.php", function(data) {
    $.each(data, function(key, value) {
      //alert(key + ":" + value);
      $('#selCaseStudies').append("<option value='" + key + "'>" + value[1] + "-" + value[2] + "</option>");
    });
  });

  //    show the dialog
  $('#dlgLoad').dialog({
    buttons: {
      "Ok": function() {
        $(this).dialog("close");
        var csd = {};
        csid = $('#selCaseStudies').val();
        //csid = prompt("casestudyid", "1");
        loadCaseStudy(csid);
      },
      "Cancel": function() {
        $(this).dialog("close");
      }
    }
  });

  //    don't call the home button handler
  evt.stopPropagation();
});

图片转代码服务由CSDN问答提供 功能建议

                    

大家好,在这里尝试重用网站所有者提供的某些代码时遇到了麻烦。 我有一个加载和保存功能,保存功能现在可以正常运行,但不能正常加载,即使在文件中我尝试重命名文件,清除缓存等,我仍然收到404错误。任何想法

 <代码> $('#btnLoad')。click(function(evt){
   //清空列表
   $('#selCaseStudies')。find('option')。remove();

   //填充案例研究列表
   $ .getJSON(“ dbs / gcsl.php”,function(data){
     $ .each(data,function(key,value){
       // alert(key +“:” + value);
       $('#selCaseStudies')。append(“ 
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

相关推荐