Jquery 使用ajax发送Html错误的Css结构
我试图用ajax发送一个html站点,但是在服务器端,css的结构被破坏了 My getInfo函数返回一个带有html文本的变量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
<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="\"margin-left:" xmlns="\"http://www.w3.org/1999/xhtml\"">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()
});