Usually I put JavaScript like this :
<head>
<title>Title goes here</title>
<script>
some JavaScript here
</script>
</head>
<body>
some codes here
</body>
but now I have a case that JavaScript code must be generated and equal with number of LI tags on HTML file:
$('#manage-1').click(function(e) {
$(this).next(".manage-content-wrap").find(".manage-content").load("test-manage-1.php");
e.preventDefault();
});
$('#manage-2').click(function(e) {
$(this).next(".manage-content-wrap").find(".manage-content").load("test-manage-2.php");
e.preventDefault();
});
I have an idea to create that JavaScript from PHP by modifying #manage-1 with variable like this : #manage-$i and any other dynamic parts.
but, is it possible to put tag inside like this :
<head>
<title>Title goes here</title>
<script>
some JavaScript here
<?php
PHP code inside script tags
?>
</script>
</head>