Forum

Browse topics, discover Works With Legrand community!

Esempio javascript

Un saluto a tutti, posso avere un esempio di come si mettono i dati personali nel javascript di esempio?


<!DOCTYPE html>
<html>
<head>
<title>JSSample</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
$(function() {
var params = {
// Request parameters
};

$.ajax({
url: "https://api.developer.legrand.com/smarther/{apiVersion}/plants?" + $.param(params),
beforeSend: function(xhrObj){
// Request headers
xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
xhrObj.setRequestHeader("Authorization","{id token}");
},
type: "GET",
// Request body
data: "{body}",
})
.done(function(data) {
alert("success");
})
.fail(function() {
alert("error");
});
});
</script>
</body>
</html>

Hello,

Can you please ask your question in english so everyone (including me) can understand ?
Thank you!

Leslie – Community Manager

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.