Hello, teacher, I use the tp6 framework to introduce wangeditor, but I cannot pass the value of the editing content to the backend. Can you help analyze it?
html:
##js code function save(){ var data = new Object; data.content = editor.getHtml(); // if (content =='') {} $.post('/index.php/admin/article/artadd',data,function(res){ },'json'); alert(data.content); } Backend code public function artadd(){ //Add a judgment so that the two are not executed at the same time if (Request::isPost()) { $title = input('post.title'); $cid = input('post.cid'); $time = time(); $content = htmlspecialchars(input('post.content')); )); $status = input('post.status'); $hot = input('post.hot'); $himg = input('post.himg'); $cimg = input('post.cimg') ; $picurl = input('post.picurl'); $file)){ $savename = \think\facade\Filesystem::putFile( 'topic', $file); // }else{ echo json_encode(['code'=>0,'msg'=> ;'Unable to upload image']); ' =>$content, ' 'hot' => $hot, ' 'himg' => $himg, 'cimg' => $cimg, ' 'picurl' => $savename, ' 'status'=>$ status, 'time' =>$time
Look at the request in the network