-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.js
More file actions
42 lines (37 loc) · 1.07 KB
/
popup.js
File metadata and controls
42 lines (37 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
let logInButton = document.getElementById('logInButton');
window.pAsyncInit = function() {
PDK.init({
appId: "4968487875086661712",
cookie: true
});
};
// (function(d, s, id){
// var js, pjs = d.getElementsByTagName(s)[0];
// if (d.getElementById(id)) {return;}
// js = d.createElement(s); js.id = id;
// js.src = "//assets.pinterest.com/sdk/sdk.js";
// pjs.parentNode.insertBefore(js, pjs);
// }(document, 'script', 'pinterest-jssdk'));
logInButton.onclick = function() {
PDK.login({ scope: "read_public" }, function (session) {
if ( ! session) {
// The user didn't authorize or closed the popup window
} else {
// Success!
console.log(session.auth_token); // Save this to the database along with other info
}
});
}
// $(document).ready(function(){
// const Url='https://api.chucknorris.io/jokes/random';
// $.ajax({
// url: Url,
// type: "GET",
// success: function(result){
// console.log(result)
// },
// error:function(error){
// console.log(`Error ${error}`)
// }
// })
// })