Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
1.24/5 (3 votes)
See more:
Hey Guys,

So I am new to the website world, I know Basic HTML and Basic CSS and that is the most I know about coding.
I have searched online for answers but it is all gibberish to me.

I am making a website and in my navi I have Home, News, Shop, Server Info and Forums.

I would like to make it to when i am on the home screen, if I click the news button, the content of the news page will show on the home page without refreshing the entire website.

I have heard about Ajax, JQuery and Javascript as well as PHP but I do not know the first thing about any of them.

Is anyone able to give me a step by step instruction on where to place the code and the code needed?

It would be very helpful and I would be very thankful!

-Regards,
Michael.
Posted
Updated 26-Oct-15 19:43pm
v2
Comments
Thanks7872 27-Oct-15 1:43am    
First of all, don't expect give me a step by step instruction on any forum sites. Nobody will be. Further, you should be using Multiview. Use Google to find out what it is.

Yes, you can. AJAX would do this for you.

According to W3C[^],
What is AJAX?
AJAX = Asynchronous JavaScript and XML.
AJAX is a technique for creating fast and dynamic web pages.
AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.

See some basic examples here,
https://css-tricks.com/dynamic-page-replacing-content/[^]
http://crunchify.com/how-to-refresh-div-content-without-reloading-page-using-jquery-and-ajax/[^]

And tutorials,
AJAX tutorial[^]
jQuery.ajax()[^]

:)

-KR
 
Share this answer
 
The question makes no sense at all. You cannot change Web site content even with refreshing the page.

The content can only be changed on the server side, but of course it can be done on the behalf of the client, and only if the server-side script is designed to do so.

Don't get me wrong: you can change the content of the page on the client side by changing DOM via JavaScript. This is not considered as "changing the site"; the change will not go outside of the browser.

Now, "step by step instructions". I often had similar questions and developed some protection against them: if such instructions were possible, people would develop some software which would simply do these steps without your help. Isn't that simple. No, no instruction can help you. You just need to learn how Web works; there is no other way. Take this Ajax:
https://en.wikipedia.org/wiki/Ajax_(programming)[^],
http://api.jquery.com/jquery.ajax[^].

That's pretty much all about Ajax. (Of course, there are different frameworks based on it, but essentially that's it.) It will seems mysterious to you until you understand: it does nothing at all without some server-side technology. It's all about getting HTTP request and processing it into some HTTP response, which can involve some side effect. This side effect, and nothing else, can change the side content. For example, you can add some files to the part of file system under the root directory set up for your site, or modify some files. A partial case of such modification would be the change in some database, which can be on a separate tier. Only if you do such persistent modifications, you really change the site's content.

So, here is another reason to say that there is nothing to instruct you about: first, you need to learn some server-side technology and choose one, or some options for a decision. Otherwise, there is nothing to talk about. So, is some "step by step instructions" are possible, they are reduced to the two: 1) learn how Web works, 2) learn some server-side technology.

If you face some problems on this way — welcome back to your questions.

—SA
 
Share this answer
 
Comments
Member 12089576 26-Oct-15 23:59pm    
When I say change the content, I mean changing what is in the <div class="container"></div> Section.
Sergey Alexandrovich Kryukov 27-Oct-15 0:43am    
It does not matter...
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900