开发者

Allowing embedding of HTML to other pages. Iframe-, Script-tag?

开发者 https://www.devze.com 2023-01-05 20:33 出处:网络
I need to allow other people to embed some of my HTML and Javascript code. The HTML code itself is too much to be copy&pasted.

I need to allow other people to embed some of my HTML and Javascript code. The HTML code itself is too much to be copy&pasted.

Should I use Iframes or script-tags for embeding it?

The script tags and iframes are used for example by Stackoverflow on Flair p开发者_如何学Goage How does those even exactly work? Aren't those a security risk?

What method would you prefer?


Make a file such as content.html and paste the html source there. Then you can include this file in the place you want to appear. For example, using php you can use

include 'path/to/content.html'; 

at the place you want to embed the html

0

精彩评论

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