先看一下Discuz!中的js代码
function Html5notification() {
var h5n = new Object();
h5n.issupport = function() {
var is = !!window.webkitNotifications;
if(is) {
if(window.webkitNotifications.check... 先看一下Discuz!中的js代码
function Html5notification() {
var h5n = new Object();
h5n.issupport = function() {
var is = !!window.webkitNotifications;
if(is) {
if(window.webkitNotifications.check... 1.eval方法
function strToJson(str){
var json = eval('(' + str + ')');
return json;
} 2.new Function方法
function strToJson(str){
var json = (new Function("return " + str))();
return json;
... xml转array
字串
$xml = simplexml_load_string($data);
$array = json_decode(json_encode($xml),TRUE);
文件
$xml = simplexml_load_file($data);
$array= json_decode(json_encode($xml),TRUE);
或者
$array = (array) sim...
/**
* js开新窗口,不被拦截
* @author aboc
**/
function open_url(url){
var tempurl = url.split("?");
var input = '';
if(typeof tempurl[1] != 'undefined'){
var query = t... $(document).ready(function()
{
alert($(window).height()); //浏览器窗口可视区域高度
alert($(document).height()); //浏览器窗口文档的高度
alert($(document.body).height());//浏览器窗口文档body的高度
alert($(document.body).ou... <script language=javascript>
//获得coolie 的值
function cookie(name){
var cookieArray=document.cookie.split("; "); //得到分割的cookie名值对
var cookie=new Object();
... <?php
function std_class_object_to_array($stdclassobject)
{
$_array = is_object($stdclassobject) ? get_object_vars($stdclassobject) : $stdclassobject;
foreach ($_array as $key => $value) {
$value = (is_array($value) || is_object($value)) ? std_class_object_to_array($value) : $value;
$array[$key] = $value;
}
return $array;
}post-commit.cmd内容如下
@echo off :: Stops commits that don't include a log message of at least 6 characters. @echo off setlocal rem Subversion sends through the repository path and ...
JS代码
function gotoTop(min_height){
//预定义返回顶部的html代码,它的css样式默认为不显示
var gotoTop_html = '<div id="gotoTop">返回顶部</div>';
//将返回顶部的html代码插入页面上id为page的元素的末尾
$("#page").... PHPZip.class.php报unpack() [function.unpack]: Type v: not enough input, need 2, have 0 in解决办法
正常的在win环境下是没问题的,但是在linux环境下就会报unpack() [function.unpack]: Type v: not enough input, need 2, have 0 in错误,解决办法...
<?php
/**
* @desc curl 方法的实现
* @author Aboc QQ:9986584
* @version 1.0
*
*/
class Curl {
/**
* url地址
*
* @var unknown_type
*/
private $_url = '';
... js代码
(function(){
//判断是否支持placeholder
function isPlaceholer(){
var input = document.createElement('input');
return "placeholde... 前台方法
<img src2="真实地址" src="占位图片" />
加个正在下载中的背景的话用样式 {background:url(/app/webroot/images/loading.gif) no-repeat center;}
//lazyload
function
lazyload(option){var
settings={defObj...
if ( !function_exists('json_decode') ){
function json_decode($json)
{
$comment = false;
$out = '$x=';
for ($i=0; $i<strlen($json); $i++)
{
if (!$comment)
...