This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
jquery:allgemein [2020/12/11 21:07] – [AJAX form post] admin | jquery:allgemein [2021/12/06 21:25] (current) – removed admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== jQuery ====== | ||
- | eigene Selektoren erstellen wie [[http:// | ||
- | |||
- | <code javascript> | ||
- | $.extend( | ||
- | $.expr[":" | ||
- | hottie: (" | ||
- | }); | ||
- | |||
- | function FindHotties() { | ||
- | $("ol a: | ||
- | } | ||
- | </ | ||
- | |||
- | |||
- | ===== HTML5 - Detect geolocation ===== | ||
- | |||
- | |||
- | <code javascript> | ||
- | // ASK GOOGLE FOR COUNTRY' | ||
- | if (navigator.geolocation) { | ||
- | navigator.geolocation.getCurrentPosition(function(position) { | ||
- | $.getJSON(' | ||
- | latlng: position.coords.latitude + ',' | ||
- | sensor: false, | ||
- | type: ' | ||
- | }, function(result) { | ||
- | var countryKey = result.results[0].address_components[5].short_name; | ||
- | console.log(countryKey); | ||
- | alert(' | ||
- | }); | ||
- | }); | ||
- | } | ||
- | </ | ||
- | |||
- | ===== AJAX post request ===== | ||
- | |||
- | <code javascript> | ||
- | $.ajax({ | ||
- | dataType: " | ||
- | type: " | ||
- | url: " | ||
- | data: " | ||
- | success: function(data) { | ||
- | // SQUEEZE OUT DATA | ||
- | console.log(data); | ||
- | } | ||
- | }); | ||
- | </ | ||
- | |||
- | ===== AJAX form post ===== | ||
- | |||
- | <code javascript> | ||
- | |||
- | $("# | ||
- | var uri = " | ||
- | $.ajax({ | ||
- | type: " | ||
- | url: uri, | ||
- | data: $("# | ||
- | | ||
- | | ||
- | } | ||
- | }); | ||
- | return false; // avoid to execute the actual submit of the form. | ||
- | }); | ||
- | |||
- | </ |