开发者

CakePHP: Alternative for Iframe?

开发者 https://www.devze.com 2023-03-25 09:29 出处:网络
I am currently using an Iframe to display a source from another doma开发者_开发知识库in on my page.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消