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 getRndInts(cnt, max){ | |
var max = max || 50; | |
var cnt = cnt || 5; | |
var rndArr = []; | |
for (var i = 0; i < cnt;) { | |
var rndInt = Math.floor(Math.random()*max + 1); | |
if(rndArr.indexOf(rndInt) !== -1){ | |
continue; | |
} else { |
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
<div id="fb-root"></div> | |
<script> | |
window.fbAsyncInit = function() { | |
// init the FB JS SDK | |
FB.init({ | |
appId : 'YOUR_APP_ID', // App ID from the app dashboard | |
channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel file for x-domain comms | |
status : true, // Check Facebook Login status | |
xfbml : true // Look for social plugins on the page | |
}); |
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
// Create the XHR object. | |
function createCORSRequest(method, url) { | |
var xhr = new XMLHttpRequest(); | |
if ("withCredentials" in xhr) { | |
// XHR for Chrome/Firefox/Opera/Safari. | |
xhr.open(method, url, true); | |
} else if (typeof XDomainRequest != "undefined") { | |
// XDomainRequest for IE. | |
xhr = new XDomainRequest(); | |
xhr.open(method, url); |
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.ajax mid - CROSS DOMAIN AJAX | |
* --- | |
* @author James Padolsey (http://james.padolsey.com) | |
* @version 0.11 | |
* @updated 12-JAN-10 | |
* --- | |
* Note: Read the README! | |
* --- | |
* @info http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/ |
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
/** | |
* | |
* Base64 encode / decode | |
* http://www.webtoolkit.info/ | |
* | |
**/ | |
var Base64 = { | |
// private property |
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 resizeTimer = 0; | |
jQuery(function() { | |
//... | |
//... | |
jQuery(window).resize(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
//there's a couple of ways. My preferred way is to attach a function to the ajaxStart/Stop events on the element itself. | |
$('#loadingDiv') | |
.hide() // hide it initially | |
.ajaxStart(function() { | |
$(this).show(); | |
}) | |
.ajaxStop(function() { | |
$(this).hide(); | |
}); | |
//The ajaxStart/Stop functions will fire whenever you do any ajax calls. |
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
-webkit-transition: top 0.5s ease 0.7s; | |
transition: top 0.5s ease 0.7s; |
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
{"verticalsResult":{"currentCity":{"baseUrl":"http://www.cobone.com/deals/dubai","urlName":"dubai","latitude":25.581,"longitude":55.697,"facebookId":"133323990035820 ","twitterId":"cobonedubai","googlePlusId":"103770203060970696536","pinterestId":"cobone","name":"Dubai","description":"Dubai","parent":{},"promos":[],"siblings":[],"children":[{"child":{"baseUrl":"http://www.cobone.com/deals/food-dining-dubai","urlName":"food-dining-dubai","latitude":0,"longitude":0,"facebookId":"133323990035820 ","twitterId":"cobonedubai","googlePlusId":"103770203060970696536","pinterestId":"cobone","name":"Food & Dining","description":"Food & Dining","grandChildren":[],"promos":[]}},{"child":{"baseUrl":"http://www.cobone.com/deals/beauty-spa-dubai","urlName":"beauty-spa-dubai","latitude":0,"longitude":0,"facebookId":"133323990035820 ","twitterId":"cobonedubai","googlePlusId":"103770203060970696536","pinterestId":"cobone","name":"Beauty & Spa","description":"Beauty & Spa","grandChildren":[],"promos":[]}},{"child":{"baseUrl":"ht |
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
{"noOfCities":13,"cities":[{"city":{"baseUrl":"http://www.cobone.com/deals/abudhabi","urlName":"abudhabi","latitude":24.455,"longitude":54.382,"facebookId":"135761843111435","twitterId":"coboneabudhabi","googlePlusId":"103770203060970696536","pinterestId":"cobone","name":"Abu Dhabi","description":"Abu Dhabi"}},{"city":{"baseUrl":"http://www.cobone.com/deals/alexandria","urlName":"alexandria","latitude":31.1981,"longitude":29.9192,"facebookId":"136543156389143 ","twitterId":"CoboneAlex ","googlePlusId":"103770203060970696536","pinterestId":"cobone","name":"Alexandria","description":"Alexandria"}},{"city":{"baseUrl":"http://www.cobone.com/deals/amman","urlName":"amman","latitude":31.95,"longitude":35.9333,"facebookId":"152768171402471","twitterId":"CoboneAmman ","googlePlusId":"103770203060970696536","pinterestId":"cobone","name":"Amman","description":"Amman"}},{"city":{"baseUrl":"http://www.cobone.com/deals/beirut","urlName":"beirut","latitude":33.8719,"longitude":35.5097,"facebookId":"145730898783705 ","twitt |
NewerOlder