This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="http://ptres.37wan.com/js/sq/lib/sq.core.js"></script> | |
<script type="text/javascript" src="http://ptres.37wan.com/js/sq/widget/sq.login.js"></script> | |
<script type="text/javascript" src="http://ptres.37wan.com/js/sq/widget/sq.clientlog.js?t=<?php echo time();?>"></script> | |
SQ.ClientLog.login({ | |
login_account: loginAccount, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript parseUrl函数(来自国外的获取网址url参数) | |
<script type="text/javascript"> | |
function parseURL(url) { | |
var a = document.createElement('a'); | |
a.href = url; | |
return { | |
source: url, | |
protocol: a.protocol.replace(':',''), | |
host: a.hostname, | |
port: a.port, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript 判断服务器资源是否存在 | |
function isEffective(url) { | |
try { | |
var xmlhttp; | |
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari | |
xmlhttp = new XMLHttpRequest(); | |
} else { // code for IE6, IE5 | |
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); | |
} | |
xmlhttp.open("get", url, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
&wd_entergame=1&wd_server=S{$reco_server["SID"]}&wd_username={$user["LOGIN_ACCOUNT"]} | |
&wd_entergame=1&wd_server=S{$reco_server["SID"]}&wd_username= | |
+login_account | |
+ "&wd_entergame=1&wd_server=S"+ | |
server_num + "&wd_username=" + login_account | |
&wd_entergame=1&wd_server=S'+server_num+'&wd_username=<?php echo $user["LOGIN_ACCOUNT"] ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NodeJS连接Mysql函数封装 | |
var mysql = require('mysql'); | |
//填写数据库连接信息,可查询数据库详情页 | |
var username = 'username'; | |
var password = 'passwork'; | |
var db_host = '127.0.0.1'; | |
var db_port = 3306; | |
var db_name = 'test'; | |
var option = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JavaScript设计模式-单例模式 | |
/*study*/ | |
/** | |
* 使用单例模式创建一个应用程序名称空间 | |
* 调用$(document).ready(myApp.init) | |
*/ | |
var myApp = { | |
//初始化 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Node.js模拟浏览器文件上传 | |
这段代码只能一次上传一个文件 | |
参考: | |
参考自(XiongLiding) 所分享代码 | |
http://www.cnodejs.org/topic/4ffed8544764b729026b1da3 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//检测一个网页上的链接是否都可以正常访问 | |
//指定测试的地址(页面): | |
$viewUrl = ""; | |
$host = ""; | |
function _striplinks($document) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// js 64编码 | |
function base64_encode(str) { | |
var base64encodechars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |
var out, i, len; | |
var c1, c2, c3; | |
len = str.length; | |
i = 0; | |
out = ""; | |
while (i < len) { | |
c1 = str.charCodeAt(i++) & 0xff; |
OlderNewer