jQueryのloadメソッドでパーツを読み込み2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="ja"> | |
<head> | |
<!-- jquery読み込み Ver.1.8.3 --> | |
<script src="js/jquery.min.js"></script> | |
<script> | |
//共通パーツ読み込み | |
$(function() { | |
$("#header").load("header.html"); | |
$("#side").load("side.html"); | |
$("#footer").load("footer.html"); | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="header"> | |
ここにheader.htmlが読み込まれる | |
</div> | |
<div id="side"> | |
ここにside.htmlが読み込まれる | |
</div> | |
<div id="main"> | |
メインコンテンツは直接記述 | |
</div> | |
<div id="footer"> | |
ここにfooter.htmlが読み込まれる | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment