wezze Posted June 10, 2012 Share Posted June 10, 2012 hey i got a little question, ive got a site where i got this the main section of my page. <section id="main" class="clearfix"> <section id="content"> <article><?php include("includes/article1_nl.php"); ?></article> </section> what i would like to achieve is when putting numbers under this article like <1-2-...etc> and pressing nr2 article 2 loads in the place of article 1 without having to make a second page only a another include page. Is this possible? thx Quote Link to comment https://forums.phpfreaks.com/topic/263953-change-1-piece-of-page-with-numbers/ Share on other sites More sharing options...
requinix Posted June 10, 2012 Share Posted June 10, 2012 AJAX. Using jQuery you could $("section#content article").load("includes/article1_n2.php"); which would work because apparently your entire article is in just that one .php file. Quote Link to comment https://forums.phpfreaks.com/topic/263953-change-1-piece-of-page-with-numbers/#findComment-1352742 Share on other sites More sharing options...
wezze Posted June 11, 2012 Author Share Posted June 11, 2012 ok cool but is that the only piece of code ill need? I had a quick look on google (now i know what to look for) and saw they use <head><script src="http://code.jquery.com/jquery-latest.js"></script></head> will i need to put this in too? <script> $("section#content article").load("includes/article1_nl2.php"); </script> thx Quote Link to comment https://forums.phpfreaks.com/topic/263953-change-1-piece-of-page-with-numbers/#findComment-1352952 Share on other sites More sharing options...
requinix Posted June 11, 2012 Share Posted June 11, 2012 will i need to put this in too? If you want to use jQuery then yes, you need to include the script from somewhere. Quote Link to comment https://forums.phpfreaks.com/topic/263953-change-1-piece-of-page-with-numbers/#findComment-1352973 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.