Master Summoner
- Joined
- Oct 9, 2008
- Messages
- 572
- Reaction score
- 14
Hi,
I'm trying to have a link that goes to "#" to load a file into a DIV with a POST value. But I seem to fail, which seems odd for me (Since I follow the exact steps in the tutorial).
I inserted a line of code where it should change the link from "Index" to "Hello World" and that happens, but it does not load the file.
Heres my source:
HTML:
my menu:
and the page it loads: (main.php):
Oh - and my version of jQuery is 1.3.2 (newest)
Thanks in advance, regards,
Andertraaks.
I'm trying to have a link that goes to "#" to load a file into a DIV with a POST value. But I seem to fail, which seems odd for me (Since I follow the exact steps in the tutorial).
I inserted a line of code where it should change the link from "Index" to "Hello World" and that happens, but it does not load the file.
Heres my source:
HTML:
Code:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="./js/jquery.js"></script>
<title>Website</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="./style/main.css" />
</head>
<body>
<div id="maincontainer">
<div id="headercontainer">
</div>
<div id="content">
<div id="menubar">
<div class="margin">
<script type="text/javascript" src="./js/menu.js"></script>
</div>
</div>
<div id="content_2"> </div>
<div id="footer">
Copyright 2009
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$(".Index").click(function() {
$("#content_2").load("./php/main.php",{page:1});
$(".Index").text("hello world");
});
});
</script>
</body>
</html>
my menu:
Code:
var out = new Array('Index','Projects','Contact','About');
for(i = 0; i < (out.length); i++) {
document.write('<a href="#" class="' + out[i] + '">' + out[i] + '</a><br />');
}
and the page it loads: (main.php):
PHP:
<?php
echo "your on page: " . $_REQUEST['page'];
?>
Oh - and my version of jQuery is 1.3.2 (newest)
Thanks in advance, regards,
Andertraaks.