I am trying to load code in Moodle through jQuery I get the following error:
Uncaught SyntaxError: Invalid or unexpected token
What am I doing wrong?
<h1 id="ciao">
<?php echo $COURSE->fullname ?>
</h1>
<a id="marko" href="report2.php">PDF</a>
<form action="manage.php" method="POST">
<select name="ciao">
<?php foreach ($result as $key => $res) { ?>
<option id="search" value="search" name="search">
<?php echo $res->uename ?>
</option>
<?php } ?>
</select>
</form>
function init() {
var search = $('#search').text();
search.click(function() {
// $.ajax({
// type: 'post',
// url: 'manage.php',
// data: {
// source1: "some text",
// source2: "some text 2"
// },
// success: function( data ) {
// console.log( data );
// }
// });
console.log('ok);
});
}
$(document).ready(init);