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
// Node-like signature with single callback, returns the XHR | |
$.xhrcb( url: String, complete: Function( err: Error, xhr: XHR, options: Object ) ): XHR; | |
$.xhrcb( options: Object, complete: Function( err: Error, xhr: XHR, options: Object ) ): XHR; | |
// Returns a Promise, throws an error if no Promise or shim | |
$.xhr( options: Object ): Promise | |
// See ticket http://bugs.jquery.com/ticket/14509 for `options` | |
// Thoughts: |
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 SomeWidget( $elem ) { | |
this.$elem = $elem; | |
} | |
SomeWidget.prototype = { | |
constructor: SomeWidget, | |
renderTo: function( target ) { | |
$( target ).append( this.$elem.on( "click mousemove", this ) ); | |
}, |
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
From: John Resig [mailto:jeresig@gmail.com] | |
Sent: Sunday, February 26, 2006 7:55 PM | |
To: Dave Methvin | |
Subject: Re: jQuery suggestions | |
> JQuery is incredibly useful. I just started playing with it yesterday | |
> and already I'm hooked. I know exactly *why* I like it so much too. | |
> Have you ever read Paul Graham's essay "Succinctness is Power"? | |
> http://www.paulgraham.com/power.html | |
> Read it, and your neck will be sore afterwards. That's what happens |
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.holdReady (true) --> don't fire ready until i say so | |
// jQuery.holdReady (false) --> ok go ahead (assuming nobody else delayed) | |
jQuery.holdReady = function( hold ) { | |
if ( hold ) { | |
jQuery.readyWait++; | |
} else { | |
jQuery.ready( 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
set path=c:\nodejs\bin;%path% | |
c:\cygwin\bin\bash -c "cd c:/vstudio/jquery; make" | |
icacls dist\jquery.js /grant Everyone:RX |
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 createSimpsons() { | |
var theSimpsons = ['Bart', 'Homer', 'Marge', 'Maggy', 'Lisa'], | |
numberOfSeasons = 21, | |
avgEpisodesPerSeason = 22; | |
$("#title").append("The Simpson Family"); | |
$("#details").append( | |
"<p>Number of seasons: " + numberOfSeasons + "</p>", | |
"<p>Episodes per season: " + avgEpisodesPerSeason + "</p>", |
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 originalEvent = event, | |
propHook = jQuery.event.propHooks[ event.type ]; | |
event = jQuery.Event( originalEvent ); | |
// If hook returns false, it doesn't want anything else done | |
if ( propHook && propHook( event, originalEvent ) === false ) { | |
return event; | |
} |
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 originalEvent = event, | |
propHook = jQuery.event.propHooks[ event.type ], | |
copy = props; | |
event = jQuery.Event( originalEvent ); | |
// propHook can return an array of props to copy | |
if ( propHook ) { | |
copy.concat( propHook( event, originalEvent) || [] ); | |
} |
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
(new Windows.Devices.Geolocation.Geolocator()).getGeopositionAsync().then(function(pos){ | |
// If lat/lon not available, just use a default | |
pos = pos || { coordinate: { latitude: 39, longitude: 76, accuracy: 42 } }; | |
$("#latlon").text( | |
"lat=" + pos.coordinate.latitude + ", lon=" + pos.coordinate.longitude + | |
", accuracy=" + pos.coordinate.accuracy+ | |
", addr=" + (pos.civicAddress.city || pos.civicAddress.state || pos.civicAddress.postalCode) | |
); |
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
fetchCurrentPosition() | |
.then(updateLocationDisplay) | |
.pipe(fetchWeatherAtThisLocation) | |
.then(updateWeatherDisplay) | |
.pipe(determineWeatherType) | |
.then(updateRecommendations) | |
.then(updateAppTile); | |
function fetchCurrentPosition() | |
{ |
OlderNewer