[NEED HELP] iFrame

Newbie Spellweaver
Joined
Apr 22, 2010
Messages
24
Reaction score
2
Hi there, i am setting up my first website. I am trying to make iframes so that when i got to the homepage - index.html, it shows the content that i want in a specific area, and when i click on say, about us, the homepage content changes to the about us content. I think this is a really basic thing to do, but i couldnt find any decent tutorials on the web. Thankyou for your support.
 
iframes are only useful when you want to have content display from other websites.(which is it mostly used for)
You could easily just use divs and just let it reload the complete page, instead of using iframes. there a lot of easier ways than iframes (I would suggest using iframes if there isn't really any other way)

I could make you a iframe website easily if needed.

for menu's I would suggest using Javascript.
 
Last edited:
No iframes then? they're not good practice... Neither is AJAX for that sort of thing... But who cares.. It's his first site no need for SE optimization anyhow. ;)

AJAX is fun.

loading some content without a page refresh isn't AJAX, theres no dynamic server requests there :p


think: XHTTPrequest.


DHTML is the correct name for it I guess.
 
as long as you use #! it's crawable by google

Unfortunately niggertons of sites don't use #! yet. One of the reasons people actually realised that they should be using #! in their URLS is because Facebook started using it, and it begged the question "why do facebook have shebangs in their urls", then people started talking about it.
 
using it is a bit tricky though, or using the hashchange vent generally, if you want the history to work properly

had to do this recently Prestigious Golf tour where I have two different types of content loading with ajax, click on "mnich" and then on "Startovní listina" and then press back button, it was pain in the ass to make and it still doesn't work properly, they better invent some more neat solution to this ajax stuff than hashes
 
loading some content without a page refresh isn't AJAX, theres no dynamic server requests there :p


think: XHTTPrequest.


DHTML is the correct name for it I guess.
Really? Please, do tell more.


@foxx,
That's pretty cool.

I'm talking about when you use AJAX to change the main margin of content in the main part of the site (bad) without any change to the address bar/etc. Search Engines do one of two things (depending on AJAX/iFrame):

Spider the initial content on the homepage only, or spider the individual pages and the homepage. With the later, if you get a ranking on those pages, google points to the content that gets thrown in the middle, with no nav bar, footer, header, etc. Not the best thing for a first-time visitor to see... Of course you could get around this, but it's easier to just avoid the circumstance in the first place.

That's why I said it's bad practice.. Using AJAX in general isn't bad, just.. if you don't think it through. :cool:

If you change the address bar a little, and keep it consistent with how the site loads given that address, there's not a single problem I have with it. (As long as you don't "rely" on JS, but that's a different issue altogether. Use it, but have a back-up plan; Don't rely on it)
 
Last edited:
Really? Please, do tell more.

(correct me if i'm wrong) but he is just trying to change static content?

if you're just swapping static content, its not what is referred to as AJAX. AJAX is specifically requesting data from the server (things like submitting a form, querying a database etc) and usually uses a separate file as a handler to do so.

At least this was my understanding of the difference?
 
(correct me if i'm wrong) but he is just trying to change static content?

if you're just swapping static content, its not what is referred to as AJAX. AJAX is specifically requesting data from the server (things like submitting a form, querying a database etc) and usually uses a separate file as a handler to do so.

At least this was my understanding of the difference?

Not exactly, AJAX is Asynchronous JavaScript And XML. You can use it to request xHTML (or HTML, or even a text document.. The name isn't very good because it's not even limited to XML, just content that can go inside an xHTML document.) It requests data from some server (not necessarily the one hosting the AJAX script). That's the only "server-side" logic AJAX requires. You don't even really need an HTTP server.. so yeh.. just a third party file that can be requested under the hypertext protocol.

OP wants to request the content from main web-pages on the site through an iFrame. Someone mentioned they got it working with AJAX. For SEO reasons, the content isn't going to be spidered in a desired way. (See my most previous post)

Hi there, i am setting up my first website. I am trying to make iframes so that when i got to the homepage - index.html, it shows the content that i want in a specific area, and when i click on say, about us, the homepage content changes to the about us content. I think this is a really basic thing to do, but i couldnt find any decent tutorials on the web. Thankyou for your support.

If the content for "about us" was inside the host page (nested in a hidden element or in the JavaScript), and no request was made to another file via JavaScript, then it's not ajax. The moment you make a request to a file through JavaScript, you're using AJAX. It's really not as complicated as it's made out to be..
 
Last edited:
Not exactly, AJAX is Asynchronous JavaScript And XML. You can use it to request xHTML (or HTML, or even a text document.. The name isn't very good because it's not even limited to XML, just content that can go inside an xHTML document.) It requests data from some server (not necessarily the one hosting the AJAX script). That's the only "server-side" logic AJAX requires. You don't even really need an HTTP server.. so yeh.. just a third party file that can be requested under the hypertext protocol.

OP wants to request the content from main web-pages on the site through an iFrame. Someone mentioned they got it working with AJAX. For SEO reasons, the content isn't going to be spidered in a desired way. (See my most previous post)



If the content for "about us" was inside the host page (nested in a hidden element or in the JavaScript), and no request was made to another file via JavaScript, then it's not ajax. The moment you make a request to a file through JavaScript, you're using AJAX. It's really not as complicated as it's made out to be..

Well thanks for explaining that :)
 
Back