別サーバでスタッフ紹介をPHPで表示させているのですが、
他のサイトでも同様にスタッフ紹介を表示させたいと思います。
メンテナンスがし易いよう、別サーバのスタッフ紹介PHPをインクルードで読み込みたいのですが、良い方法はないでしょうか。
できればJavascriptでできると嬉しいのですが可能でしょうか。
下記ページを参考に試してみましたが、うまくできないようでした。
http://blog.looseknot.jp/html/js-include.html
##試した内容
<!DOCTYPE html> <html lang="ja-jp"> <head> <meta charset="utf-8"> <title>Page Title</title> <script type="text/javascript" src="js/jquery-1.5.2.min.js"></script> <script type="text/javascript" src="js/jquery.cookie.js"></script> <script type="text/javascript"> <!-- $(function(){ $.ajaxSetup({cache:false}); $("div.include").load("http://hoge.jp/test.php"); }); --> </script> </head> <body> <div class="include"></div> </body> </html>
回答1件
あなたの回答
tips
プレビュー