lundi 2 mars 2015

Same Html across multiple pages


I am looking to have a chunk of html containing a heading which i want to reuse across multiple html pages.


I have tried the EXACT code but it doesn't seem to work. it is displaying the script in HTML rather than actioning it.


index.html:



<html>

<h1>This is a test</h1>

$('#content').load('commonContent.html');

</html>


commonContent.html:



<div id="content"><h2>If this shows my test worked!</h2></div>


Any suggestions would be much appreciated. Please note i am a newbie to javascript!





Aucun commentaire:

Enregistrer un commentaire