As a beginner in front end development, I am finding it a bit challenging at the moment. Here's what I have so far:
- 1 main HTML file (index.html)
- 1 JavaScript file (something.js)
- 2nd HTML file (something.html)
Main HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/something.js"></script>
</head>
<body>
<div class="container-fluid well-lg">
<div id="targetInformation">
</div>
</div>
</body>
<html>
2nd HTML:
<div class=" col-md-4 col-sm-6 col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Some title
</h3>
</div>
<div class="panel-body">
<p>info1</p>
<p>info2</p>
<p>info3</p>
</div>
</div>
</div>
I would like to create a loop using JavaScript/jQuery/AJAX to load the content from the 2nd HTML file into the first HTML file 6 times. I understand that I will need to use $.get(). Any suggestions on how my JavaScript should be structured and how to utilize JavaScript within a div? Thank you in advance for your help :) I've tried looking for a solution myself but couldn't find one, sorry for any inconvenience.
Note: I haven't included my something.js file because it is currently empty, and I am unsure of how to begin.