dongnai8013 2015-12-07 23:09
浏览 18

没有刷新页面

Hello I wanna make my website subpages with no refresh but I encountered problem.

thats is my structure of php files

index.php
 /pages folder
   add.php
   search.php
   login.php

and if i wanna go to add.php i have link ?page=add and the same for rest. Header and footer, styles, includes are in index.php I made container #content there should be loaded content from pages folder files.

And what is the problem - when i use this script there is no sending variables from index.php

like Notice: Undefined variable: _LANG in C:\xampp\htdocs\webpage\search.php on line 34

but when I dont use this jquery script, all variables are sending and everything is ok. Why is this happening and how to fix that

I made like this

YT VIDEO so that is my jquery for that script i using modr rewrite so from address, for instance /?page=search = /search and then this is exact path pages/' + page + 'php

$(document).ready(function(){
      $('header ul.header_actions > li > a').click(function(){
         var page = $(this).attr('href');
         $('#content').load('pages/' + page + 'php');
         return false;
      });
});   

</div>
  • 写回答

1条回答 默认 最新

  • doushao6874 2015-12-07 23:15
    关注

    are you missing a .

    $(document).ready(function(){
      $('header ul.header_actions > li > a').click(function(){
         var page = $(this).attr('href');
         $('#content').load('pages/' + page + '.php');
         return false;
      });
    }); 
    
    评论

报告相同问题?