Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 使用ajax发送Html错误的Css结构_Jquery_Css_Ajax - Fatal编程技术网

Jquery 使用ajax发送Html错误的Css结构

Jquery 使用ajax发送Html错误的Css结构,jquery,css,ajax,Jquery,Css,Ajax,我试图用ajax发送一个html站点,但是在服务器端,css的结构被破坏了 My getInfo函数返回一个带有html文本的变量 <div id="Center">center<button style="margin-left: 109px; margin-top: -9px; position: absolute;">juhu</button></div> 但在服务器站点(php页面)上,post变量的值如下: <div id="Ce

我试图用ajax发送一个html站点,但是在服务器端,css的结构被破坏了

My getInfo函数返回一个带有html文本的变量

<div id="Center">center<button style="margin-left: 109px; margin-top: -9px; position: absolute;">juhu</button></div>
但在服务器站点(php页面)上,post变量的值如下:

<div id="Center">center<button absolute;\"="" position:="" -9px;="" margin-top:="" 109px;="" style="\&quot;margin-left:" xmlns="\&quot;http://www.w3.org/1999/xhtml\&quot;">juhu</button></div>
centerjuhu
怎么了?
谢谢

如果我没弄错的话,这应该可以:

$.ajax({
url:"createFile.php",
type:"post",
dataType:"html",
processData:false,
data:getInfo()
});

问题是反斜杠。我希望jquery在每个“”上添加一个反斜杠。 解决方案是php服务器站点上的“stripslashes”函数

$.ajax({
url:"createFile.php",
type:"post",
dataType:"html",
processData:false,
data:getInfo()
});