if(flag){
alert("you are here");
}else{
alert("ss"):
}
var LoadJavascript=function(pattern){
pattern = pattern || "Insert-DOM";
var loadPattern={
"XHR-Eval":function(url,callback){
url = url+"?noCache="+(new Date()).getTime();
callback=callback || function(obj){};
var xhr=false;
if(window.XMLHttpRequest){
xhr=new XMLHttpRequest();
}else{
try{
xhr=new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
}
xhr.open("GET",url,true);
xhr.onreadystatechange=function(){
if(xhr.readyState === 4 && ( xhr.status === 200 || xhr.status === 304)){
eval(xhr.responseText);
callback(xhr);
}
}
xhr.send(null);
},
"XHR-Injection":function(url,callback){
url = url+"?noCache="+(new Date()).getTime();
callback=callback || function(obj){};
var xhr=false;
if(window.XMLHttpRequest){
xhr=new XMLHttpRequest();
}else{
try{
xhr=new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
}
xhr.open("GET",url,true);
xhr.onreadystatechange=function(){
if(xhr.readyState === 4 && ( xhr.status === 200 || xhr.status === 304)){
var script = document.createElement("script");
document.getElementsByTagName("head")[0].appendChild(script);
script.setAttribute("id",url.match(/\/(\w+)\.js/)[1]);
script.setAttribute("type","text/javascript");
script.text=xhr.responseText;
callback(xhr);
}
}
xhr.send(null);
},
"Iframe":function(){
var iframe=document.getElementById("iframe");
document.body.appendChild(iframe);
iframe.setAttribute("width","0");
iframe.setAttribute("height","0");
iframe.setAttribute("src",url);
},
"Insert-DOM":function(url,callback){
url = url+"?noCache="+(new Date()).getTime();
callback=callback || function(obj){};
var script=document.createElement("script");
document.getElementsByTagName("head")[0].appendChild(script);
script.setAttribute("id",url.match(/\/(\w+)\.js/)[1]);
script.setAttribute("type","text/javascript");
script.setAttribute("src",url);
if(script.onreadystatechange){
script.onreadystatechange=function(){
if(script.status === "loaded" || script.status === "complete"){
callback(script);
}
}
}else{
script.onload=function(){
callback(script);
}
}
}
}
return loadPattern[pattern];
}
//Usage:
// LoadJavascript("XHR-Eval")("http://www.ilovejs.net/test.js");
var LoadJavascript=function(pattern){
pattern = pattern || "Insert-DOM";
var loadPattern={
"XHR-Eval":function(url,callback){
url = url+"?noCache="+(new Date()).getTime();
callback=callback || function(obj){};
var xhr=false;
if(window.XMLHttpRequest){
xhr=new XMLHttpRequest();
}else{
try{
xhr=new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
}
xhr.open("GET",url,true);
xhr.onreadystatechange=function(){
if(xhr.readyState === 4 && ( xhr.status === 200 || xhr.status === 304)){
eval(xhr.responseText);
callback(xhr);
}
}
xhr.send(null);
},
"XHR-Injection":function(url,callback){
url = url+"?noCache="+(new Date()).getTime();
callback=callback || function(obj){};
var xhr=false;
if(window.XMLHttpRequest){
xhr=new XMLHttpRequest();
}else{
try{
xhr=new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
}
xhr.open("GET",url,true);
xhr.onreadystatechange=function(){
if(xhr.readyState === 4 && ( xhr.status === 200 || xhr.status === 304)){
var script = document.createElement("script");
document.getElementsByTagName("head")[0].appendChild(script);
script.setAttribute("id",url.match(/\/(\w+)\.js/)[1]);
script.setAttribute("type","text/javascript");
script.text=xhr.responseText;
callback(xhr);
}
}
xhr.send(null);
},
"Iframe":function(){
var iframe=document.getElementById("iframe");
document.body.appendChild(iframe);
iframe.setAttribute("width","0");
iframe.setAttribute("height","0");
iframe.setAttribute("src",url);
},
"Insert-DOM":function(url,callback){
url = url+"?noCache="+(new Date()).getTime();
callback=callback || function(obj){};
var script=document.createElement("script");
document.getElementsByTagName("head")[0].appendChild(script);
script.setAttribute("id",url.match(/\/(\w+)\.js/)[1]);
script.setAttribute("type","text/javascript");
script.setAttribute("src",url);
if(script.onreadystatechange){
script.onreadystatechange=function(){
if(script.status === "loaded" || script.status === "complete"){
callback(script);
}
}
}else{
script.onload=function(){
callback(script);
}
}
}
}
return loadPattern[pattern];
}
//Usage:
// LoadJavascript("XHR-Eval")("http://www.ilovejs.net/test.js");
/*
* from javascript is dancing
*/
var foreachChildNodes = function(el, fn, depth){
var nodes = el.childNodes;
var content='it was going wrong';
depth = depth || 1; // the key here
var d = --depth;
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
if (d > 0 && node.childNodes.length > 0) {
foreachChildNodes(node, fn, d);
}
if (node.nodeType === 1) {
fn(node);
}
}
}
<!-- can you help me
no,I can't. i am so sorry about that.
-->
<div>
<p>sdfsjdlfjalsdjfalsdjflasdjkljfkladjfkljsdffffffffffffffffffffffffffffffffffffff 推我不出来了,:)
</p>
</div>
<?php
if(extension_loaded('zlib')){
ob_start('ob_gzhandler');
}
header ("content-type: text/css; charset: gb2312");
header ("cache-control: must-revalidate");
$offset = 60 * 60 * 60 * 24;
$expire = "expires: " . gmdate ("D, d M Y H:i:s", time() + $offset) . " GMT";
header ($expire);
ob_start("compress");
function compress($buffer) {
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
return $buffer;
}
include('style.css'); //读取css文件
if(extension_loaded('zlib')){
ob_end_flush();
}
?>