解决json包含html标签无法显示的问题
主要是将json无法识别的字符进行转义
function dotran($str) {
$str = str_replace('"','\\"',$str);
$str = str_replace("\r\n",'\\r\\n',$str);
$str = str_replace("\t",'\\t',$str);
$str = str_replace("\\",'\\',$str);
$str = str_replace("\b",'\\b',$str);
return $str;
}
这样返回的数据就可以正常显示,下面是转换后的内容:
jsontext='{"jqry":[{"id":"121","userid":"0","status":"1","filename":"","url":"333333333","title":"aaaaaaa","type":"WatchTV","seq":"1","remark":"remarktext","content":"<p>\\r\\n\\t<object classid=\\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\\" codebase=\\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\\"><param name=\\"quality\\" value=\\"high\\" /><param name=\\"movie\\" value=\\"
相关文档:
访问控件的主要对象是:document对象。分别对应当前文档所有的(子对象)个人观点。并且已经提供的几个主要方法来访问对象。
1. document.getElementById
2. document.getElementsByName
3 &n ......
HTML 5——下一代web开发标准
HTML5看来将成为主流,浏览器战争乃至整个互联网的发展也将围绕这一点展开。而Flash、Silverlight和JavaFX等等RIA技术,将面临严峻的生存挑战
参考51cto
http://developer.51cto.com/art/200907/133407.htm ......
String.prototype.HTMLEncode = function() {
var temp = document.createElement ("div");
(temp.textContent != null) ? (temp.textContent = this) : (temp.innerText = this);
var output = temp.innerHTML;
temp = null;
return output;
}
String.prototype.HTMLDecode = function() {
var temp = doc ......
鼠标的多种样式...
<P><a href="help.htm" style="cursor:hand">手</a>
<a href="help.htm" style="cursor:text">文本</a>
<a href="help.htm" style="cursor:MOVE">四个方向的箭头</a>
<a href="help.htm" st ......
在Web开发中,常常要用到两个窗口之间互相传值。下面谈谈父子窗口之间的传值:
一:使用Open开启子窗口
1:单值传递
通过open开启的子窗口比较好处理。
页面窗口1.html代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<body>
<form name=" ......