dpqmu84646 2019-04-25 08:08
浏览 39

JSON不发送到文件

I have migrated my website to a different domain. Everything was working until the migration. Now my JSON POST Function returns nothing, its like the file doesnt exists. No code has been changed just the actual URL of the website.

  $.ajax({
  url:"/wp-content/themes/atex-assembly/grp-enclosure-122x120x90/load.php",
  method: "post",
  data: { loadDump: JSON.stringify( loadDump )},
  success: function(data){
   wp_send_json_error( 'Error: Invalid data!' );
  console.log(data);
  var ArrayReturn = JSON.parse(data);
  console.log(ArrayReturn);
  window.localStorage.setItem('ArrayReturn', JSON.stringify(ArrayReturn));
  window.localStorage.setItem('loadDumpStore', JSON.stringify(loadDumpHash));
  console.log(localStorage);
  window.location.hash = loadDumpHash;
  window.location.reload();
  }
})
});

load.php

      require_once("/kunden/homepages/41/d753118124/htdocs/atex-assembly/wp- 
      load.php");
      global $wpdb;
      global $current_user;

    // //Get the string from front end to match against database for query
    $loadDump =   wp_unslash( $_POST['loadDump'] );
    $loadDumpDecode =   json_decode( $loadDump );


        $table_name= $wpdb->prefix. 'product_configurator';
        $DBP_results= $wpdb->get_results("SELECT * FROM $table_name WHERE 
        keymap_key = '$loadDumpDecode'");
        $DBP_current_user = get_current_user_id();

     foreach($DBP_results as $DBP_cols){
        $user_id= $DBP_cols->user_id;
        $enclosure_type= $DBP_cols->enclosure_type;
        $keymap_key= $DBP_cols->keymap_key;
        $key_map_loaded= json_decode($DBP_cols->key_map);
        }


      echo json_encode($key_map_loaded);
  • 写回答

1条回答 默认 最新

  • duanhuang4841 2019-04-25 08:16
    关注

    The Jquery File needed to be updated due to the new WordPress update.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题