Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding examples from official website
It's handy to have everything you need in one repository. Source files were mostly pulled from Eli's website with only a minor edit. http://eligrey.com/blog/post/pmxdr-postmessage-cross-domain-request-library
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
This is how one could use PHP and Apache to serve up the host portion to | ||
make pmxdr work. | ||
|
||
Installation: | ||
|
||
1. Create a `pmxdr` directory at your document root. | ||
2. Copy in the `htaccess` here to `.htaccess` in your document root, or merge it with your own rules. This Rewrites calls from `/pmxdr/api` to `/pmxdr/api.php` | ||
3. Copy in `pmxdr-host.js` to the `pmxdr` folder in your document root. | ||
4. Optional: Minify `pmxdr-host.js` and put that into the `pmxdr` folder too. If you do this, modify `api.php` to include your minified version. | ||
5. Edit `api.php` and set up your allowed hosts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
//pmxdr host server-side logic | ||
|
||
ob_start("ob_gzhandler"); | ||
|
||
$version = "0.0.6"; | ||
|
||
header("Content-Type: text/html; charset=UTF-8"); | ||
header("ETag: ".$version); | ||
//Uncomment to cache for almost forever | ||
//header('Expires: Wed, 31 Dec 9999 00:00:00 GMT'); | ||
|
||
?><!doctype html><script type="text/javascript"><?php include('pmxdr-host.js')?></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
RewriteEngine On | ||
|
||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteCond %{REQUEST_FILENAME}.php -f | ||
RewriteRule (.*) $1.php [L,QSA] |