postmessage
This commit is contained in:
47
client/src/seatmap.ts
Normal file
47
client/src/seatmap.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import jQuery = require("jquery");
|
||||
import Utils from './utils';
|
||||
// var parseString = require('xml2js').parseString;
|
||||
// import axios from 'axios';
|
||||
|
||||
// let checkoutParams: string[];
|
||||
// let posturl: string;
|
||||
|
||||
|
||||
window.addEventListener('load', function () {
|
||||
jQuery("#foobar").on("click", () => {
|
||||
Utils.sendMessage({ message: "Hello from parent", date: Date.now() }, "parent");
|
||||
});
|
||||
});
|
||||
|
||||
window.addEventListener('message', function(e) {
|
||||
console.log("Child: Received");
|
||||
|
||||
const data = JSON.parse(e.data);
|
||||
console.log(data);
|
||||
});
|
||||
|
||||
// jQuery(($) => {
|
||||
// parseQueryString();
|
||||
// console.log(checkoutParams);
|
||||
// console.log(posturl);
|
||||
|
||||
// axios.get(posturl)
|
||||
// .then(function (response) {
|
||||
// // handle success
|
||||
// console.log(response);
|
||||
// })
|
||||
// .catch(function (error) {
|
||||
// // handle error
|
||||
// console.log(error);
|
||||
// });
|
||||
// .then(function () {
|
||||
// // always executed
|
||||
// });
|
||||
|
||||
// });
|
||||
|
||||
// function parseQueryString() {
|
||||
// const urlParams: URLSearchParams = new URLSearchParams(window.location.search);
|
||||
// checkoutParams = JSON.parse(<string>urlParams.get('checkoutParams'));
|
||||
// posturl = <string>urlParams.get('posturl');
|
||||
// }
|
||||
Reference in New Issue
Block a user