I get code from a website, something like (file name: index.php):
<html>
<body>
<div class="menu" title="example">Click here to change the content from a html file</div>
<div id="content"></div>
<script>
$(".menu").click(function() {
var page = $(this).attr("title");
$.post("content.php", {"page": page}, function(html){ $("#content").html(html);});
});
</script>
</body>
</html>
In "content.php":
<?php
ob_start();
include 'index.php';
ob_end_clean();
$page = $_POST['page'];
$file = $page."html";
include($file);
?>
It works fine for a simple $page."html" file. However, if I put some complicated JavaScript in $page."html", it does not work. I'm wondering why, how and what is .html(html)? I can't find any reference about passing parameter as html. What is "html" here?