Почему это не работает? Он должен загружать содержимое другого html файла в DIV с нижним идентификатором
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript">
function loadContent(href, container){
$wrapper = $('<div>');
$wrapper.addClass('loaded_content_wrapper').appendTo(container).load(href, function(){
$(this).animate({marginLeft:0}, 'slow').prevAll().animate({marginLeft:'-100%'}, 'slow', function(){
$(this).remove();
});
})
}
</script>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<div onClick="loadContent('hello-world.html', $('#bottom'))">Home</div>
<div id="bottom">
ramkaramka
</div>
</html>
Он работал, если добавить тег script для jquery.js и установить jquery.js, hello-world.html
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
function loadContent(href, container){
$wrapper = $('<div>');
$wrapper.addClass('loaded_content_wrapper').appendTo(container).load(href, function(){
$(this).animate({marginLeft:0}, 'slow').prevAll().animate({marginLeft:'-100%'}, 'slow', function(){
$(this).remove();
});
})
}
</script>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<div onClick="loadContent('hello-world.html', $('#bottom'))">Home</div>
<div id="bottom">
ramkaramka
</div>
</html>