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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Chrome Developer Tools</title> | |
</head> | |
<body> | |
<a href="#">click</a> | |
<script type="text/javascript"> | |
var a = 123; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Chrome Developer Tools</title> | |
</head> | |
<body> | |
<a href="#" id="c">click</a> | |
<script type="text/javascript"> | |
function t(x){ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Javascript</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var a={ | |
x:1, | |
y:2, |
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
# Trash sites | |
0.0.0.0 diybl.com | |
0.0.0.0 jb51.net // Lots of ads | |
0.0.0.0 tgbus.com | |
# MSN ADS | |
127.0.0.1 rad.msn.com | |
127.0.0.1 rad.live.com | |
# Activepower ADS |
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
//Returns an object reference to the identified element. | |
function id(i){ | |
return document.getElementById(i); | |
} | |
//Returns a list of elements with the given tag name. | |
function tagName(t){ | |
return document.getElementsByTagName(t); | |
} | |
//Returns a list of elements with the given name. | |
function name(n){ |
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
$.ajax({ | |
url : 'someurl', | |
type : 'POST', | |
data : ...., | |
tryCount : 0, | |
retryLimit : 3, | |
success : function(json) { | |
//do something | |
}, | |
error : function(xhr, textStatus, errorThrown ) { |
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
$(document).ready( | |
var xhr; | |
var fn = function(){ | |
if(xhr && xhr.readyState != 4){ | |
xhr.abort(); | |
} | |
xhr = $.ajax({ | |
url: 'ajax/progress.ftl', | |
success: function(data) { |
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
set nocompatible | |
set tabstop=4 | |
set shiftwidth=4 | |
set softtabstop=4 | |
set smartindent | |
set hlsearch | |
set incsearch | |
set ignorecase |
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
// Return the current scrollbar offsets as the x and y properties of an object | |
function getScrollOffsets(w) { | |
// Use the specified window or the current window if no argument | |
w = w || window; | |
// This works for all browsers except IE versions 8 and before | |
if (w.pageXOffset != null) return {x: w.pageXOffset, y:w.pageYOffset}; | |
// For IE (or any browser) in Standards mode | |
var d = w.document; | |
if (document.compatMode == "CSS1Compat") return {x:d.documentElement.scrollLeft, y:d.documentElement.scrollTop}; | |
// For browsers in Quirks mode |
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
// Asynchronously load and execute a script from a specified URL | |
function loadasync(url) { | |
var head = document.getElementsByTagName("head")[0]; // Find document <head> | |
var s = document.createElement("script"); // Create a <script> element | |
s.src = url; // Set its src attribute | |
head.appendChild(s); // Insert the <script> into head | |
} |
OlderNewer