Forum Moderators: open

Message Too Old, No Replies

iframe or AJAX

what is the best way to load content within the same window?

         

Mobull

10:10 am on Jan 5, 2006 (gmt 0)

10+ Year Member



I have an old website which still uses frames. It has the famous left side navigation with buttons, which onclick changes the content in the right frame. I want to update this to something newer.

The server is able to handle scripts (asp/php).

I don't want to reload the complete page, since that would be a waste of bandwith and response time I guess.

After my Frames time, I started using Iframes, which made it a little better. Now I have been reading about AJAX which is able to load content within a div dynamically.

Would it be a good idea to load the content of the page (which is normally a new page) in to a div? So it would load: text and images (but no buttonbar, layout and styles since they are already included in that page)?

Is this a good idea and if not, what will be wrong with it?

ajkimoto

3:33 pm on Jan 5, 2006 (gmt 0)

10+ Year Member



Mobull,

AJAX definitely seems to be a coming technology, but some older browsers will not be able to handle the XMLHttpRequest() method.

An older technique that can give you a similar result is iframe RPC. You can load data into a hidden iframe and then use JS to access the iframe contents. If search google for 'iframe rpc', you should see some good resources.

On the other hand, if you are not concerned with older browsers, AJAX might just fit the bill.

ajkimoto

Mobull

11:00 pm on Jan 5, 2006 (gmt 0)

10+ Year Member



Thanks for that clear answer!
Some more questions popped up about search engines...

Will it affect search engines in any way? Is there anything I should think of before I actually change these pages? Or will it not have any effect?

abbeyvet

11:52 pm on Jan 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't want to reload the complete page, since that would be a waste of bandwith and response time I guess.

That is not the case. All the layout elements of the page, the images, any style sheets or javascripts or whatever, will already be in the users cache. So the bandwidth saving and decreased reponse time are marginal at best and not really worth considering.

There are sometimes good reasons for loading pages individually, but that isn't one of them.

whoisgregg

6:15 pm on Jan 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Will it affect search engines in any way?

Basically, the search engines see what is in "View Source" for any given URL. If your pages are all the same URL and you are using javascript to change the content, you aren't actually showing anything to the search engines.

Mobull

7:27 pm on Jan 6, 2006 (gmt 0)

10+ Year Member



Thus in other words...using AJAX to change the content of your page (e.g. by loading other pages in your main page) will affect search engines in a negative way? Hmmm if that is the case then I have to stick with my old fashioned way I guess. Though I wonder if (i)frames are perfect...

whoisgregg

4:24 pm on Jan 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, negative only if you care about search engines. :)

What you'll need to do is make sure that there are still real, hard-coded links to the different "pages" of your site in your source code.

Plus, for your users, you want to make sure that when they are looking at a particular "page" of your AJAX swapping content that they can copy and paste the URL from the address bar to bookmark or send to a friend. This problem is being dealt with in creative ways by the AJAX pioneers out there. (Try some searches for "ajax bookmark," "ajax back button," or similar topics.)

Mobull

6:43 am on Jan 8, 2006 (gmt 0)

10+ Year Member



thanks for all the answers people. Really appreciated.