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')
| rm -r .git | |
| git init | |
| (create files) | |
| git add -A | |
| git commit -m 'Initial commit' | |
| git remote add origin <url> | |
| git push --force --set-upstream origin master |
| function objectToQuerystring (obj) { | |
| return Object.keys.reduce(function (str, key, i) { | |
| var delimiter, val; | |
| delimiter = (i === 0) ? '?' : '&'; | |
| key = encodeURIComponent(key); | |
| val = encodeURIComponent(obj[key]); | |
| return [str, delimiter, key, '=', val].join(''); | |
| }, ''); | |
| } |
| "use strict"; | |
| var _ = require('lodash'); | |
| /** | |
| * Custom matchers for protractor and jasmine 2 | |
| * | |
| * expect(el).toBePresent(); | |
| * expect(el).toBeDisplayed(); | |
| * expect(el).toContainText('text to contain'); |
| 'use strict'; | |
| // generated on 2014-06-24 using generator-gulp-webapp 0.1.0 | |
| var src_dir = 'app', | |
| dest_dir = 'dist'; | |
| var gulp = require('gulp'); | |
| // load plugins |
| • SSH to your server to start creating a subdomain (https://library.linode.com/hosting-website#sph_configuring-name-based-virtual-hosts) | |
| • Go to ~/public/ | |
| › mkdir -p sub.example.com/{public,log,backup} | |
| › cd sub.example.com/public/ | |
| › nano index.html | nano index.php | |
| • Write 'Hello world' or whatever, we just need a html|php file to test with |
| $base-font-size: 16px; | |
| $base-line-height: 1.5; | |
| // this value may vary for each font | |
| // unitless value relative to 1em | |
| $cap-height: 0.68; | |
| @mixin baseline($font-size, $scale: 2) { |
| /** | |
| * Calculates numbers to the mathmatical power (exponent) | |
| * | |
| * @since 1.0.0 | |
| * | |
| * @param int $number The number to increase | |
| * @param int $exponent The power to increase the number by | |
| * | |
| * @return int The new number | |
| */ |
| /** | |
| * Fix for vw, vh, vmin, vmax on iOS 7. | |
| * http://caniuse.com/#feat=viewport-units | |
| * | |
| * This fix works by replacing viewport units with px values on known screen sizes. | |
| * | |
| * iPhone 6 and 6 Plus cannot run iOS 7, so are not targeted by this fix. | |
| * Target devices running iOS 8+ will incidentally execute the media query, | |
| * but this will still produce the expected result; so this is not a problem. |