Skip to content

Instantly share code, notes, and snippets.

View 8bu's full-sized avatar
🪵
Sending logs

Long Nguyen 8bu

🪵
Sending logs
View GitHub Profile
@8bu
8bu / README.md
Created February 17, 2020 08:42 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@8bu
8bu / autoloadComponents.js
Created May 9, 2019 19:02 — forked from Gkiokan/autoloadComponents.js
Autoload *.vue files as Component and register them
/*
Autoload all current vue files as component and register them by their name.
---
Author: Gkiokan Sali
Date: 2019-05-09
*/
import Vue from 'vue'
const requireContext = require.context('./', false, /.*\.vue$/)
@8bu
8bu / axios-catch-error.js
Created October 1, 2018 13:38 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
axios.put(this.apiBaseEndpoint + '/' + id, input)
.then((response) => {
// Success
})
.catch((error) => {
// Error
if (error.response) {
// The request was made and the server responded with a status code
// that falls out of the range of 2xx
// console.log(error.response.data);