Include the content from other webpages: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
| Line 5: | Line 5: | ||
# compare the content from two webpages | # compare the content from two webpages | ||
= approach = | = client-side approach = | ||
== frame or iframe == | == frame or iframe == | ||
* frame or [http://www.w3.org/TR/html401/present/frames.html#h-16.5 iframe tag], [http://www.w3.org/TR/html4/struct/objects.html#h-13.5 object tag] | * frame or [http://www.w3.org/TR/html401/present/frames.html#h-16.5 iframe tag], [http://www.w3.org/TR/html4/struct/objects.html#h-13.5 object tag] | ||
** 缺點是瀏覽器上的鏈結,非該篇網頁的靜態鏈結。 | ** 缺點是瀏覽器上的鏈結,非該篇網頁的靜態鏈結。 | ||
** cross frame layers | ** cross frame layers | ||
| Line 22: | Line 17: | ||
<script language="JavaScript" type="text/javascript" src="path/to.js"></script> | <script language="JavaScript" type="text/javascript" src="path/to.js"></script> | ||
<noscript><a href="URL">Description</a><noscript> | <noscript><a href="URL">Description</a><noscript> | ||
== jQuery == | |||
* [http://api.jquery.com/load/ .load()] | |||
= server-side approach = | |||
== Apache == | |||
* [http://httpd.apache.org/docs/1.3/howto/ssi.html Server side includes][http://dob.tnc.edu.tw/themes/old/showPage.php?s=1997&t=3&at=]({{Acronym | acronym=SSI | def=Server Side Include}}) | |||
== PHP require / include function == | == PHP require / include function == | ||
| Line 45: | Line 49: | ||
other software | other software | ||
* [[MovableType]]: template modules, or [http://www.sixapart.com/pronet/plugins/plugin/multiblog.html MultiBlog] plugin | * [[MovableType]]: template modules, or [http://www.sixapart.com/pronet/plugins/plugin/multiblog.html MultiBlog] plugin | ||
= further reading = | = further reading = | ||
Revision as of 17:17, 3 June 2013
Multiple approaches for including the content from other webpages
usage
- seperate the navigation and content into two parts
- compare the content from two webpages
client-side approach
frame or iframe
- frame or iframe tag, object tag
- 缺點是瀏覽器上的鏈結,非該篇網頁的靜態鏈結。
- cross frame layers
javascript
- general (JavaScript Tip: Page Headers And Footers)
<script language="JavaScript" type="text/javascript" src="path/to.js"></script> <noscript><a href="URL">Description</a><noscript>
jQuery
server-side approach
Apache
PHP require / include function
PHP require_once(), include function ...
troubleshooting:
- (When I browsed some_file.php which include )Warning: include_once(lib.php) [function.include-once]: failed to open stream: No such file or directory in ...common/view.php
common/lib.php common/view.php //the file included common/lib.php some_file.php //the file included common/view.php
- solution:
- Using CONSTANT parameter (such as absolute file path in common configuration file) in the included path NOT using relative path
- Resolving PHP Relative Paths Problems - Ant's ATField
wiki softwares
- DokuWiki export
- Mediawiki: MediaWiki Template or transclude syntax(Mediawiki formatting rules)
- Oddmuse wiki: Transclusion means to include a wiki page from elsewhere into your current page
other software
other software
- MovableType: template modules, or MultiBlog plugin
further reading
- Boutell.Com, Inc. (2007). How Do I Include One HTML File in Another? / Jennifer Kyrnin (n.d.). [2]