直接看代码<?php
$arr = '[{"url":"gray-01.jpg","alt":"Gray"},{"url":"gray-02.jpg","alt":"Gray"},{"url":"gray-03.jpg","alt":"
JSON文件内容格式[
{"title":"aaaaaaaaa","content":"bbbbbbbbbbbbbbbbbb","page":"1"},
{"title":"ccccccccc","content":"dddddddddddddddddd","page":&q
必须调用jquery.js;代码:<div class="adsense_l" id="index_1_L">
<script type="text/javascript">
/**
* 产生随机整数,包含下限值,包括上限值
* @param {N
html页面:<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<script type="text/javascript" src="jquery-1.8.2.min.js"></script
header('Content-type: text/javascript');
//消除Resource interpreted as Script but transferred with MIME type text/html警告
json_encode(数组对象);
//字符串转换成json对象
json_decode( $Contents)
//转成数组对象
echo $_GET['callback'] .'('. json_encode(json_encode("字符串对象")) .');';
//返回执行体
其实类似于
js 里面也可以用eval_r(字符串);
苗景云的博客
<< 向左走,向右走 >>
<< 向左走,向右走 >>