[jQuery]No file loaded..

Results 1 to 5 of 5
  1. #1
    Account Upgraded | Title Enabled! Mindblaster7 is offline
    True MemberRank
    Oct 2008 Join Date
    DenmarkLocation
    862Posts

    [jQuery]No file loaded..


    RaGEZONE Recommends

    RaGEZONE Recommends

    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">&nbsp;</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 Code:
    <?php

    echo "your on page: " $_REQUEST['page'];


    ?>
    Oh - and my version of jQuery is 1.3.2 (newest)

    Thanks in advance, regards,
    Andertraaks.


  2. #2
    (oO (||||) (||||) Oo) jM2.me is offline
    Alpha MaleRank
    Aug 2009 Join Date
    USA (Fuck Yeah)Location
    2,575Posts

    Re: [jQuery]No file loaded..

    Sorry for offtopic but can you post link to tutorial or send it to pm?
    Thanks,

  3. #3
    Account Upgraded | Title Enabled! Mindblaster7 is offline
    True MemberRank
    Oct 2008 Join Date
    DenmarkLocation
    862Posts

    Re: [jQuery]No file loaded..

    Quote Originally Posted by ProKiller002 View Post
    Sorry for offtopic but can you post link to tutorial or send it to pm?
    Thanks,
    Sure thing.
    http://15daysofjquery.com/quick-and-dirty-ajax/14/

  4. #4
    Account Inactive ExploitR is offline
    InactiveRank
    Aug 2009 Join Date
    23Posts

    Re: [jQuery]No file loaded..

    You are aware that the ./ is referring to the folder above i assume ? :x

  5. #5
    Account Upgraded | Title Enabled! Mindblaster7 is offline
    True MemberRank
    Oct 2008 Join Date
    DenmarkLocation
    862Posts

    Re: [jQuery]No file loaded..

    Quote Originally Posted by ExploitR View Post
    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




Advertisement