↧
jQuery Serialize form to JSON
12345678910111213141516$.fn.serializeObject = function() { var o = {}; var a = this.serializeArray(); $.each(a, function() { if (o[this.name]) { if (!o[this.name].push) {...
View ArticleCheck element visibility with Javascript
The following function checks if a given element is within browser’s viewport: 12345678910function isScrolledIntoView(elem) { var docViewTop = $(window).scrollTop(); var docViewBottom =...
View ArticleThe missing php function: mysql_fetch_all
The function: 12345678function mysql_fetch_all($query, $kind = 'assoc') { $result = array(); $kind = $kind === 'assoc' ? $kind : 'row'; eval('while(@$r = mysql_fetch_' . $kind . '($query))...
View ArticleUsing Curl with APC
Function to do a curl request or grab results from apc. Useful when requesting a source that takes to long to grab and does not change very often....
View Article