jQuery templates not working (jQuery 3.4.1)

471 Views Asked by At

I am not sure what is wrong with my code. When I open it in Firefox, it doesn't do anything. However, copying it into fsfiddle it works

Am I missing a JavaScript file for jQuery templates but I thought this was added to jQuery in 1.5 why

 <!DOCTYPE html>
<html>
<head>
<script src="scripts/jquery-3.4.1.js"></script>
<script src="scripts/main.js"></script>

<meta charset="UTF-8">
<title>Exam Random Generator</title>
</head>

<body>
    <div id ="mainContainer">   </div>

    <script id="questionTemplate" type="text/x-jQuery-tmpl">
        <div class="questionContainer">
            <p class="question">${sQuestionText}</p>            
        </div>
        <br/>
    </script>
    <script type="text/javascript">
        // Render the books using the template

        $("#questionTemplate").tmpl(oQuestions).appendTo("#mainContainer");
    </script>
</body>

</html> 
0

There are 0 best solutions below