This file contains hidden or 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
buttonClickEventHandler(); //если нужно при первом запуске получить json чик | |
$("#quote-button").on("click",buttonClickEventHandler) | |
function buttonClickEventHandler(e) { | |
$.ajax({ | |
url: 'https://andruxnet-random-famous-quotes.p.mashape.com/?cat=movies', // указываем URL и | |
dataType: "json", // тип загружаемых данных | |
headers: { | |
"X-Mashape-Key": "", //здесь должен быть ключ по котромую даеться доступ выдаеться провайдером REST API | |
"Accept": "application/json" | |
}, |
This file contains hidden or 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="floating-panel" data-toggle="hello i am data-toggle value"> | |
//... | |
//</div> | |
var dataToggleStr=document.getElementById("floating-panel").dataset.toggle; | |
console.log(dataToggleStr); //"hello i am data-toggle value" |
This file contains hidden or 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
// in html <script src="https://maps.googleapis.com/maps/api/js?key=GOOGLE_API_FOR_GEOCODER&signed_in=true&callback=initGeocoder" defer></script> | |
var currentLat; | |
var currentLng; | |
//callback is success | |
function success(pos) { | |
var crd = pos.coords; | |
currentLat = crd.latitude; | |
currentLng = crd.longitude; | |
}; | |
//callback if error |
This file contains hidden or 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
//+ it is space | |
//&hl=ru languge for search in google | |
https://www.google.com/search?q=javascript+tutorials&hl=ru |
This file contains hidden or 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
$.ajax({ | |
url: 'https://simple-weather.p.mashape.com/weatherdata?lat=' + coords[0] + '&lng=' + coords[1], | |
type: 'GET', | |
dataType: 'json', | |
success: function(data) { | |
console.log(data.query.results.channel.item.condition.temp); | |
var unit = data.query.results.channel.units.temperature; | |
$(".country").html(data.query.results.channel.location.country); | |
$(".city").html(data.query.results.channel.location.city); |
This file contains hidden or 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 getMeta(url){ | |
var img = new Image(); | |
img.addEventListener("load", function(){ | |
alert( this.naturalWidth +' '+ this.naturalHeight ); | |
}); | |
img.src = url; | |
} | |
getMeta("http://.../... .png"); |
This file contains hidden or 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 url = "http://.../...png"; | |
var img = new Image(); | |
img.addEventListener("load", function() { | |
var foundElement = document.getElementsByClassName("MyClassNameForDivWithBackgroundImage")[0]; | |
foundElement.style.width = this.naturalWidth+"px"; | |
foundElement.style.height = this.naturalHeight+"px"; | |
}); | |
img.src = url; |
This file contains hidden or 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
NAME | |
Invoke-RestMethod | |
SYNTAX | |
Invoke-RestMethod [-Uri] <uri> [-Method <WebRequestMethod> {Default | Get | Head | Post | Put | Delete | Trace | Options | Merge | Patch}] [-UseBasicParsing] [-WebSession <WebRequestSession>] | |
[-SessionVariable <string>] [-Credential <pscredential>] [-UseDefaultCredentials] [-CertificateThumbprint <string>] [-Certificate <X509Certificate>] [-UserAgent <string>] [-DisableKeepAlive] | |
[-TimeoutSec <int>] [-Headers <IDictionary>] [-MaximumRedirection <int>] [-Proxy <uri>] [-ProxyCredential <pscredential>] [-ProxyUseDefaultCredentials] [-Body <Object>] [-ContentType <string>] | |
[-TransferEncoding <string> {chunked | compress | deflate | gzip | identity}] [-InFile <string>] [-OutFile <string>] [-PassThru] [<CommonParameters>] | |
This file contains hidden or 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>jQuery demo - wikipedia suggestion</title> | |
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"> | |
</head> | |
<body> |
This file contains hidden or 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
<!-- need bootstrap.css for quick start --> | |
<div class="container"> | |
<h2>Form control: textarea</h2> | |
<p>The form below contains a textarea for comments:</p> | |
<form role="form"> | |
<div class="form-group"> | |
<label for="comment">Comment:</label> | |
<textarea class="form-control" rows="5" id="comment"></textarea> | |
<button type="button" class="btn btn-default">Default</button> | |
</div> |