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 lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Event Pooling, or perhaps Pub/Sub</title> | |
<script type="text/javascript" charset="utf-8" src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js"></script> | |
</head> | |
<body> | |
<strong>Who is this?</strong> | |
<form action="#" method="get" accept-charset="utf-8" id="whoisit"> |
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 lang="en"> | |
<head> | |
<title>HTML for .searchText() jQuery Plugin, custom helper text input value</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
</head> | |
<body> | |
<h1>.searchText() jQuery Plugin, adding search helper text / behavior</h1> | |
<ol> | |
<li> |
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
(function($) { | |
/** | |
* .matchHeight() | |
* - match heights of multiple columns that use css layout with floating elements | |
*/ | |
$.fn.matchHeight = function(options) { | |
// set the containing element and set elements used as columns | |
var defaults = { | |
container : '.main', | |
columns : 'div', |
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.noConflict(); | |
(function($) { // $ is jQuery | |
// plugin for yada yada | |
$.fn.yadayada = function(options) { | |
var defaults = { | |
foo : 'bar' | |
}; | |
// Extend our default options with those provided. | |
var opts = $.extend({}, defaults, options); | |
// Do something to each item |
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
// using jQuery library and validation plugin in this code | |
// for checking keycodes | |
function getKeyCode(event) { | |
var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode)); | |
return keycode; | |
} | |
// is there an anchor as Submit button? | |
var $submit = $('a[id$="_submit"]'); | |
// is there any behavior already on submit, like -> onclick="__doPostBack(...)" |
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
// Check if images load properly | |
// returns false if image not loaded | |
function imgOK(img) { | |
if (!img.complete) { | |
return false; | |
} | |
if (typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) { | |
return false; | |
} | |
return true; |
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
def importHTML | |
require 'open-uri' | |
@source = open("http://domain.com/some.html").read | |
end | |
# uses a reference parameter when getting remote XML | |
def importXML | |
require 'open-uri' | |
@aclass = AClass.find(params[:id]) # expecting a param named ref | |
@content = open("http://domain.com" + @aclass.ref + "&type=xml").read |
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
// Grid | |
// =========================== | |
// e.g. 960px, 12 columns (px) : | 10+ | 60 + 20 (x11) | 60 + 10 | | |
// Setup your grid ... | |
// total page width | |
!gTotal = 960px | |
// number of columns | |
!grid = 16 | |
// gutter between columns |
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
/* Pixelhandler namespace. */ | |
if (!window.PXHLR) { var PXHLR = {}; } | |
/** | |
* PXHLRbrowserName - add browser info to class | |
* @return sting like ... | |
* webkit, opera, msie, mozilla | |
* written in into the class attribute of obj | |
*/ | |
(function($) { |
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
/** | |
* method to test string for XSS | |
* @name PXHLR.preventXSS | |
* @type Function | |
* @member PXHLR | |
* @returns String that doesn't allow XSS Cross Site Scripting attack | |
*/ | |
PXHLR.preventXSS = function (str) { | |
var paramStr = str; |
OlderNewer