PHP4でJavaScriptを動かしてみよう:phpjs
2006年07月19日-
スポンサード リンク
phpjs - the PHP/JavaScript interpreter
This scripting language interpreter is implemented in PHP and allows to execute user-supplied JavaScript-lookalike code server-side, without compromising security because everything runs safely in a sandbox. This is of course much slower than a real interpreter, but is useful for integration into CMS/Wiki engines to have users extend a sites' dynamic functions. It can be connected to the hosting interpreter (PHP) by allowing access to certain (interface) functions and even PHP variables.
PHP4スクリプト内にJavaScriptのコードを書いてサーバサイドでJavaScriptを動かすためのライブラリ、phpjs。
次のようなスクリプトが動作します。
<?php
include("js.php");
js_exec('
document.writeLn("Hello World!");
', JSE_CACHE|JSE_ACCEL);
?>
js.phpがjavascriptインタプリタになります。
出力例
Hello World!
関連エントリ
PHP5上でJavascriptを動かす: J4P5
関連の記事検索:PHP
スポンサード リンク
Advertisements
SITE PROFILE
最新のブログ記事(新着順)
- 2012年2月10日 管理人のブックマーク
- ブラウザ上でPDFを表示するJSライブラリ「PDF.js」
- 次世代の検索フォームを作成するjQuery&CSS3サンプル
- 2012年2月9日 管理人のブックマーク
- faviconを書き換えてfacebookの通知っぽくしてくれるfaviconアラート実装ライブラリ「Tinycon」
- ページめくりを実現するためのjQueryプラグイン集
- 2012年2月8日 管理人のブックマーク
- HTMLをアップするとCSSのスケルトンを自動生成してくれる「bearcss」
- HTML5で綺麗でインタラクティブなグラフが描けるライブラリ「Flotr2」
- 2012年2月7日 管理人のブックマーク
- 過去のエントリ



















間違いの指摘をしていただける方はメール、あるいはTwitterでお願いします(クリック)




