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
/* Wrong */ | |
function Unicode() | |
{ | |
var table = []; | |
for(var i=0; i < 99999; i++) | |
{ | |
table.push(String.fromCharCode(i) ) | |
} | |
return table; | |
} |
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
jQuery Templating: | |
<pre> | |
$("#foo").prepend | |
( | |
$("<div>", | |
{ | |
//data attribute for AJAX URL | |
"data-href": myurl(), | |
//function call for markup |
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
Fail: | |
#ffa | |
Pass: | |
##ffffffaa |
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
Fail: | |
[code] | |
<!doctype html> | |
<head> | |
<style> | |
pre { position:absolute; clip: rect(0, 100%, 100%, 0); } | |
pre:focus { clip: rect(0, auto, auto, 0); } | |
</style> | |
</head> | |
<pre tabindex="1">hi</pre> |
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
Fail: | |
var payload = $.param({"strategy": node}, true); | |
Pass: | |
var w3_param = $.param({"strategy": node}, true); | |
var ie_param = String("strategy=").concat( | |
encodeURIComponent( | |
JSON.stringify(node).replace(/\\"/g,"\u0022") | |
).replace(/%22/,"").replace(/%22$/,"") | |
); |
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
Fail: | |
$.ready(foo) | |
Pass: | |
$(foo) |
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
Mistake: | |
var selector = ("'$greetings' '$friend'").replace(/\$([^']+)/g, dict[RegExp.$1]) | |
Correction: | |
var selector = ("'$greetings' '$friend'").replace(/\$([^']+)/g, expand) | |
function expand(match, offset, fullstring) | |
{ | |
... | |
} |
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
@media handheld { @import handheld.css } | |
@media test { @import test.css } | |
var baseURL = !!page_config.url.cdn ? page_config.url.cdn + "/cdn/mysite/" : "" | |
var ie = "onpropertychange" in document; | |
var browsermap = { "true": ie_param, "false": w3_param }; | |
var w3_param = [".addEventListener","\u0022DOMAttrModified\u0022",",false"]; | |
var ie_param = [".attachEvent","\u0022onpropertychange\u0022",""]; | |
var result = "document.getElementById(\u0022foo\u0022)".concat(browsermap[ie][0], "(", browsermap[ie][1], ",bar", browsermap[ie][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
# | |
# Specify System Administrator credentials | |
# that will login to Salesforce to retrieve the metadata. | |
# | |
# You will also need the security token. | |
# | |
# The server url is which instance to connect to: | |
# For sandboxes, use https://test.salesforce.com | |
# For production or developer orgs, use https://login.salesforce.com | |
# |
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
var data = [{"keyword": "foo"}, {"keyword": "bar"}, {"keyword": "baz"}]; | |
var matchObject = {keyword:'baz', index: 0}; | |
var matchArray = data.filter(function(value, index) {return value.keyword === matchObject.keyword }); | |
var index = 0; | |
var result = []; |
OlderNewer