I want to load an html file (“hello_world.html”) inside
another html page (“index.html”) both files in the same location.
This is the code I wrote. But It is not loading anything.
both alerts are working ( which I intentionally gave to check whether
jquery is working or not .no other use with it)
what is the error in the code ? I dont want to use ajax.
</head>
<script type="text/javascript" src="../jquery-1.3.2.js"></script>
<script type="text/javascript">
$("document").ready(function() {
alert("ya loaded");
$('#container').load('hello_world.html');
alert("finished");
});
</script>
</head>
<body>
<div id="container">
</div>
</body>
Use your firebug or chrome development console to check out possible mistakes.
Edit:
When you use ajax, sometimes browser will not load it using
file:///protocol.You should be using a web server locally (such as xampp on windows or just apache),
and aproach your website in
http://protocol.That is very likely cause of your problem.