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')
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Alpine Ajax test</title> | |
| </head> | |
| <body> | |
| <h1>Users API Retrieval Test</h1> |
| <?php | |
| /** | |
| * Populate ACF select field options with Gravity Forms forms | |
| */ | |
| function acf_populate_gf_forms_ids( $field ) { | |
| if ( class_exists( 'GFFormsModel' ) ) { | |
| $choices = []; | |
| foreach ( \GFFormsModel::get_forms() as $form ) { | |
| $choices[ $form->id ] = $form->title; |
| #!/bin/bash | |
| # Creator: Phil Cook | |
| # Modified: Andy Miller | |
| # | |
| # >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh | |
| # >>> Kept here for legacy purposes | |
| # | |
| osx_major_version=$(sw_vers -productVersion | cut -d. -f1) | |
| osx_minor_version=$(sw_vers -productVersion | cut -d. -f2) | |
| osx_patch_version=$(sw_vers -productVersion | cut -d. -f3) |
| import express from 'express' | |
| import bodyParser from 'body-parser' | |
| import cookieParser from 'cookie-parser' | |
| import passport from 'passport' | |
| import passportJWT, { ExtractJwt, Strategy as JwtStrategy } from 'passport-jwt' | |
| import bcrypt from 'bcrypt' | |
| import jwt from 'jsonwebtoken' | |
| const { fromExtractors, fromAuthHeaderWithScheme, fromAuthHeaderAsBearerToken } = ExtractJwt |
| #!/bin/bash | |
| # This script | |
| # - creates a user (named below) | |
| # - sets up a union (aufs) filesystem on top of the users immutable home | |
| # - creates a cleanup script (/usr/local/bin/cleanup.sh) that empties the aufs | |
| # layer on login/logout/boot | |
| # - replaces the lightdm config | |
| # - replaces rc.local to run the script | |
| # |
| <?php | |
| /** | |
| * Turn all URLs in clickable links. | |
| * | |
| * @param string $value | |
| * @param array $protocols http/https, ftp, mail, twitter | |
| * @param array $attributes | |
| * @return string | |
| */ | |
| public function linkify($value, $protocols = array('http', 'mail'), array $attributes = array()) |