html getJSON 无效,该怎么解决
html getJSON 无效
页面 用JQuery 提交到php 但是一用到 getJSON方法 我写的js代码就无效了。用$post()就没事。但是。返回的东西我完全看不懂 php返回的时候用 echo json_encode($data) 然后回来的数据就是下面这样的
[{null:"6","0":"6",null:"2","1":"2",null:"3","2":"3",null:"3","3":"3",null:".92","4":".92
",null:".15","5":".15",null:".23","6":".23",null:"1.83","7":"1.83",null:".31","8":".31",n
ull:".46","9":".46"}]
搞了一天完全没的头绪。新手刚接触PHP 三天
框架用的好像是 CI + Smarty 用的之前的项目做的模板。但是 之前的项目查询数据库的时候 字段名什么的全是英文名。。。现在公司全改成中文名称了。。。最苦恼碰到乱码问题了。还有PHP 怎么调试ajax请求还不知道。
------解决方案--------------------
echo json_encode($data)
$data 里面的中文必须是 utf-8 的

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.

Logging in CakePHP is a very easy task. You just have to use one function. You can log errors, exceptions, user activities, action taken by users, for any background process like cronjob. Logging data in CakePHP is easy. The log() function is provide

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP is an open source MVC framework. It makes developing, deploying and maintaining applications much easier. CakePHP has a number of libraries to reduce the overload of most common tasks.
