Overclock.net banner

1 - 11 of 11 Posts

·
Registered
Joined
·
3,844 Posts
Discussion Starter #1
I am looking to learn some code to create an event that will not load the header, footer and some other areas of a site. I am looking for a way that it will allow the visitor to believe they are on the same page and not actually going to other pages. Can someone direct me on where to go or what it is called please. Love to be able to do this in some Javascript
 

·
Premium Member
Joined
·
13,477 Posts
Quote:
Originally Posted by graphicsman;12991143
I am looking to learn some code to create an event that will not load the header, footer and some other areas of a site. I am looking for a way that it will allow the visitor to believe they are on the same page and not actually going to other pages. Can someone direct me on where to go or what it is called please. Love to be able to do this in some Javascript
This is called Ajax, and it's way beyond the scope of a single forum post. A couple of places to start would be:

http://www.w3schools.com/ajax/ajax_intro.asp
http://www.ajaxtutorial.net/
 

·
Premium Member
Joined
·
6,685 Posts
Would definitely suggest the w3 link error10 threw out there, by far the best.
 

·
Registered
Joined
·
109 Posts
IMO those tutorials are useless. If you use the standard javascript way you are wasting time. Alot of time.

Look at:
http://jquery.com/
http://api.jquery.com/jQuery.ajax/
jQuery is a javascript framework that is used on pretty much any major website. I could probably bet $100 that more than 3/4 of the fortune 500 use jquery.

To learn the jQuery ajax methods I would suggest:
http://net.tutsplus.com/tutorials/javascript-ajax/5-ways-to-make-ajax-calls-with-jquery/
http://sixrevisions.com/javascript/the-power-of-jquery-with-ajax/
http://www.devirtuoso.com/2009/07/beginners-guide-to-using-ajax-with-jquery/

It would also be good to read up on how data is transferred. Usually its JSON, but XML and SOAP are also used sometimes.
 

·
Registered
Joined
·
886 Posts
Doesn't sound like AJAX to me. I think he just needs to "hide" some parts of the page (DOM Manipulation or just plain CSS). jQuery is definitely a good suggestion for js framework, but stay away from the AJAX stuff as it will just confuse what you are trying to do.

You probably can achieve what you describe with a simple jquery click event handler ( or whatever event you are going to capture ) and a few lines of javascript and css.

Example:
If your markup is as follows, obviously greatly simplified:

Code:

Code:
...
 [URL=]Click Me[/URL]
...
For a click event you would just have a short snippet of jQuery code. This should hide the header and footer.

Code:

Code:
Didn't test this code, and you will probably have to modify it some to get where you want, but should be a good start point. If you give us some better description of what you are doing, may be able to help more.

BTW, don't forget to include the jQuery library before using any of the js code here.
 

·
Registered
Joined
·
3,844 Posts
Discussion Starter #6
thanxs guys, i was hoping it would be a simple jQuery event, just trying to figure out which one it was is the hard part. I dont mind going back to AJAX but it would be a mess. Needless to say it is written to run without any Javascript or jQuery in the event someone has the script disabled.
 

·
Premium Member
Joined
·
13,477 Posts
Quote:


Originally Posted by Irythros
View Post

IMO those tutorials are useless. If you use the standard javascript way you are wasting time. Alot of time.

I disagree that knowing what's really going on is a waste of time.
 

·
Registered
Joined
·
109 Posts
Quote:


Originally Posted by error10
View Post

I disagree that knowing what's really going on is a waste of time.


You must be one of those code nazis that prefer the old way of writing 100% everything from scratch vs using a mature project

The jQuery library is not encoded/encrypted. If he wants to learn what is going on, read that. But if it works to what is needed, then why bother reading the low-level parts? He's not google, and W3S is usually a waste of time on anything important.
 

·
Premium Member
Joined
·
13,477 Posts
Quote:


Originally Posted by Irythros
View Post

You must be one of those code nazis that prefer the old way of writing 100% everything from scratch vs using a mature project

The jQuery library is not encoded/encrypted. If he wants to learn what is going on, read that. But if it works to what is needed, then why bother reading the low-level parts? He's not google, and W3S is usually a waste of time on anything important.

Because you need at least a basic understanding of JavaScript in order to use jQuery.
 

·
Registered
Joined
·
3,844 Posts
Discussion Starter #11
Quote:
Originally Posted by error10;13024176
Because you need at least a basic understanding of JavaScript in order to use jQuery.
I will agree to that
 
1 - 11 of 11 Posts
Top