CakePHP: Alternative for Iframe?
I am currently using an Iframe to display a source from another doma开发者_开发知识库in on my page.
I was wondering if there was a better solution with Cakephp?
Is it possible to display a site from another domain with php or ajax-jquery?
Thanks in advance
With php, you can try to use file_get_contents
http://php.net/manual/function.file-get-contents.php
With ajax that is difficult because you can't make a request in ajax to an other domain but if you is the owner, you can use the special header Access-Control-Allow-Origin
In php you can use file_gets_contents().
If you are looking for jQuery ajax these links may help.
http://api.jquery.com/jQuery.ajax/
You can also try this:
http://book.cakephp.org/view/1592/Js
精彩评论