Hello,
im trying to get the ajax .load() function working and its working correctly,
but if i put a document.write function on a page that is getting requested through the .load function
it doesnt load?
part of my iphone.js looks like this
function loadMenu(user) {
window.scroll(0,0);
$('body').append('<div id="progress">Loading Menu...</div>');
$('#container').load('loggedin.php?user='+user, hijackLinks);
}
function loadPage(url) {
$('body').append('<div id="progress">Loading123...</div>');
if (url == undefined) {
$('#container').load('login.php #container', hijackLinks);
} else {
$('#container').load(url + ' #container' , hijackLinks);
}
}
function hijackLinks() {
$('container a').click(function(e){
e.preventDefault();
loadPage(e.target.href);
});
var title = $('h1').html() || 'Hello';
$('h2').html(title);
$('h1').remove();
$('#progress').remove();
}
and part of my loggedin.php looks like this
<body>
<div align="center">
<h1>Welcome <?php echo $user; ?></h1>
<script type="text/javascript">
document.write("Welcome You");
</script>
any ideas people?
SASmith
Simon Smith