Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[jQuery]No file loaded..

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:
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.
 
Newbie Spellweaver
Joined
Aug 3, 2009
Messages
23
Reaction score
0
You are aware that the ./ is referring to the folder above i assume ? :x
 
Master Summoner
Joined
Oct 9, 2008
Messages
572
Reaction score
14
You are aware that the ./ is referring to the folder above i assume ? :x

Yes. I write ./ to mark that it needs to navigate from the folder this file is located in. Some webservers that needs to work with a link like /php/main.php will use it diffrent than ./php/main.php
 
Back
Top