The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.
Send messages to iframe using iframeEl.contentWindow.postMessage
Recieve messages using window.addEventListener('message')
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
var myConfObj = { | |
iframeMouseOver : false | |
} | |
window.addEventListener('blur',function(){ | |
if(myConfObj.iframeMouseOver){ | |
console.log('Wow! Iframe Click!'); | |
} | |
}); | |
document.getElementById('YOUR_CONTAINER_ID').addEventListener('mouseover',function(){ |
<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<script src="./parse_url.js"></script> | |
<script type="text/javascript"> | |
var url1 = "http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread#msg-content"; |
(function (window) { | |
var transitions = { | |
'transition': 'transitionend', | |
'WebkitTransition': 'webkitTransitionEnd', | |
'MozTransition': 'transitionend', | |
'OTransition': 'otransitionend' | |
}, | |
elem = document.createElement('div'); | |
for(var t in transitions){ |
<span class="logo" data-logo="examplelogo"></span> | |
<!-- By default the .logo element should span 100% width. | |
If you need it to be constrained in size use a container element with a width % value on it --> | |
<style> | |
.logo--header { | |
width: 25%; | |
} | |
</style> | |
<div class="logo--header"> |
/* | |
* Generate a SVG-sprite mixin for Sass | |
* ==================================== | |
* | |
* Gaya Kessler - http://gaya.ninja - http://twitter.com/GayaNinja | |
* | |
* SVGSprite is a wonderful package, but doesn't enable responsive sprites out of the box. | |
* This moustache template generates a sass file with a mixin for the generated SVG-sprite. | |
* Calculates the position and size of the background by filename. | |
* Included SVG image scales to width and height. |
/// Function to get next map item | |
/// returns next map item or fallback value if map, key or next item does not exist | |
/// Github Repo: https://github.com/elcheio/sass-map-get-next-prev | |
/// Node Module: https://www.npmjs.com/package/sass-map-get-next-prev | |
/// | |
/// @author Simon Koch <agorilla@me.com> | |
/// | |
/// Licensed under the MIT license. | |
/// | |
/// @access public |
function makeIndex() { | |
return Math.random().toString(12).substring(2, 12); | |
} | |
function Awesome() { | |
Object.defineProperty(this, 'index', { | |
writable: false, | |
configurable: false, | |
value: makeIndex() | |
}); |
Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force |