thaiscorpion Posted March 25, 2009 Share Posted March 25, 2009 hiya all another little problem again ,when i click on my links to go to say home page or login, it reloads the hole page, and that isnt necesery, is there any way to make my links only refresh the main body of the page and leave the header and my side links where they are? i hope i explianed my self.PS: i know this can be done with frames but im trying not to use them they mess my page up .thanx in advance. Link to comment Share on other sites More sharing options...
Tykain Posted March 25, 2009 Share Posted March 25, 2009 You would need to use AJAX to do that without using frames. Link to comment Share on other sites More sharing options...
thaiscorpion Posted March 25, 2009 Author Share Posted March 25, 2009 ok thanx ill take a look at the tutorial Link to comment Share on other sites More sharing options...
jlhaslip Posted March 26, 2009 Share Posted March 26, 2009 By the time Ajax does the job of refreshing a portion of the page, a full page refresh could be made. But see what you come up with. Link to comment Share on other sites More sharing options...
Tykain Posted March 26, 2009 Share Posted March 26, 2009 Yeah, AJAX is most likely unnecessary unless you really need to conserve bandwidth. Link to comment Share on other sites More sharing options...
JC5 Posted March 26, 2009 Share Posted March 26, 2009 Hi Scorpion :)You should not use Ajax for the sake of saying you have Ajax on your site. You can just as easily use regular JavaScript to achieve this same effect. I am curious why you posted this in the CSS forum as CSS is just used for positioning and styling elements. HTML would have been a more appropriate starting forum for this thread. Link to comment Share on other sites More sharing options...
thaiscorpion Posted March 27, 2009 Author Share Posted March 27, 2009 GH4 well that has a quick and easy answer cose im a newbie and ive got no idea but thanx its all been cleared now Link to comment Share on other sites More sharing options...
thescientist Posted March 30, 2009 Share Posted March 30, 2009 Hi Scorpion :)You should not use Ajax for the sake of saying you have Ajax on your site. You can just as easily use regular JavaScript to achieve this same effect. I am curious why you posted this in the CSS forum as CSS is just used for positioning and styling elements. HTML would have been a more appropriate starting forum for this thread.i really like that avatar! hahaha. Link to comment Share on other sites More sharing options...
chibineku Posted March 31, 2009 Share Posted March 31, 2009 hiya. I'm only a n00b, but I'll throw in my 2 cents on this one.I'm trying to do a similar thing, so that menu items don't load a new page, they just load new content into page divs. It's pretty easy to do using java script: <script type="text/javascript">function changeSection(content) { xmlDoc.async=false; xmlDoc.load(content + ".xml") result = xmlDoc.getElementsByTagName("CONTENT")[0].childNodes[0].nodeValue; document.getElementById("content").innerHTML = "<div class='content'><p class='wrap'>" + result + "</p></div>";}</script> <div class="left"> <p class ="table" onclick="changeSection('welcome')">welcome</p> <p class ="table" onclick="changeSection('news')">news</p> <p class ="table" onclick="changeSection('literature')">literature</p>.......</div> The document.getElementById("content") part in the first section finds <div class="content"> and changes the content depending on the CONTENT element of a .xml file with a name corresponding to the menu item clicked on. The difficulty is then styling the output. So far, I've just got the output in one class of <p> tags, which doesn't do anything fancy, but if you wanted to have links in the text or special fonts, you'd have to create a new element in the xml file and then positioning it would be, well, hard. So it might not be the ideal solution unless your output is to be fairly consistent and not have a lot of special formatting. The advantages are that it's instant and looks really clean, since there isn't any page loading time or whatever. Something to think about, anyway... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.