Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
80
rated 0 times [  86] [ 6]  / answers: 1 / hits: 17905  / 10 Years ago, wed, june 25, 2014, 12:00:00

Well I wish to show a given piece of code multiple times on a given page but I wish to minimize the redundant code being repeated everywhere (simple copy/paste) . Well I heard of people using Javascript or JQuery to store the given piece of code say HTML or CSS and than they use some simple div renders or the <!--data--> tag multiple number of times in wherever place they want the code to appear, which I have no idea how to use that is store a info in the scripts or html and then render it multiple number of places with a single div or comment.



Can anyone illustrate how to do this with an example. A bit more info on such tricks will be very resourceful.


More From » jquery

 Answers
4

Have a look at server side includes



Include it like this in your page :



<?php include ('content.html'); ?>

[#70444] Monday, June 23, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
patriciakiarrac

Total Points: 532
Total Questions: 100
Total Answers: 89

Location: Ivory Coast
Member since Sun, Mar 7, 2021
3 Years ago
patriciakiarrac questions
;