헤더랑 테일 html파일을  인쿠르드

헤더랑 테일 html파일을  인쿠르드

QA

헤더랑 테일 html파일을  인쿠르드

답변 2

본문

 헤더랑 테일 html파일을 

 메인 html 위 아래에 

인쿠르드시키고싶은데 서버 언어없이

제이쿼리로 가능한 방법좀 알수있을가요?

 

더좋은 방법이 잇다면.. 알고싶습니다.

수순 html css로 작업중입니다.

이 질문에 댓글 쓰기 :

답변 2

Server Side includes 를 이용하면 됩니다.

단점도 있어요.

아래 링크 참조

https://httpd.apache.org/docs/current/ko/howto/ssi.html

 

그런데 순수 HTML CSS 로 할 수 있는것이 없을텐데요.

서버 관계없이 돌아가는 샘플 모델을 만드시고자 하는 것 같은데....

실전에는 무용해요.

그런 사이트는 사실상 없으니까요.

공부는 많이 되겠지만 쓸모는 없어요.

 

jquery 필요없구요.

그냥 javascript로 하시면 되요. 그런데 거듭말하지만 의미가 없어요.

이 경우엔 인클루드가 아니죠. 그냥 스크립트 이용하시면 되는데요.

 

막 해보면... 아래코드 >> 황당하죠... 원하는것 하기도 힘들고요.

--- include.js -------

function headerTop() {   document.write "<div class='headCssTopMenu'>탑메뉴</div>"; }

function headerBodyStart() {   document.write "<div class='headCssBody'>"; }

function headerBodyEnd() {   document.write "</div>"; }

function headerFoot() {   document.write "<div class='headCssFoot'>풋터</div>"; }

 

--- index.html ----

<script src="include.js"></script>

<script>headerTop();</script>

<script>headerBodyStart();</script>

여기 바디 코딩

<script>headerBodyEnd();</script>

<script>headerFoot();</script>

 

 

그냥 php 쓰시면

----- index.php ----------

<? include "headerTop.php" ?> >>> 이 포함 파일들은 미리 작성하셔야 해요.

<? include "headerBodyStart.php" ?>

여기 바디 코딩

<? include "headerBodyEnd.php" ?>

<? include "headerBodyEnd.php" ?>

 

얼풋 비슷해보이지만 실제로 해보시면 훨 간단하고 자유도도 높아요.

 

위 답-댓글에서 :: 쉬우면서 바로 적용가능한게있을까요? 

>> 이 말은 뭔말인지 모르겠어요.

간단하긴 다 간단하거든요.

전 php 가 더 간단해요.

문법을 잘 모르시면 간단히 공부 하시면 되고요.

참고 : https://palpit.tistory.com/327  https://www.codingfactory.net/10121

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 0
© SIRSOFT
현재 페이지 제일 처음으로