沃梦达 / 编程问答 / php问题 / 正文

等价于 HTML 中的 include()

Equivalent of include() in HTML(等价于 HTML 中的 include())

本文介绍了等价于 HTML 中的 include()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I was wondering wether there is a way to include some html content inside another html using only html?

A replacement to PHP's

<?php include("file.php"); ?>

Is this possible?

EDIT:

This has brought up some confusion, what I needed was "almost an html tag" that had the functionality of including a html document in another.

解决方案

It cannot be done purely by HTML. (There are iframes, however, but I don't think that qualifies in this case.)

It can be done using JavaScript. You get the other file via Ajax, and place its contents inside an HTML element on the current page.

这篇关于等价于 HTML 中的 include()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:等价于 HTML 中的 include()

基础教程推荐