Forum Moderators: coopster

Message Too Old, No Replies

Is there a php alternative for i-frames?

         

sssweb

4:58 pm on Oct 30, 2011 (gmt 0)

10+ Year Member



I have a site on which I want to serve a series of brief text points (like a PowerPoint presentation). Since only the text content is changing, I was thinking to use an I-frame, with each point linking to the next w/in the same frame.

Given the disadvantages of frames in general, I'm hoping there might be a php alternative. I know of php include(), but I'm not sure how to handle the whole series of points. Is that workable, or is there another function that could handle this?

luismartin

6:28 pm on Oct 30, 2011 (gmt 0)

10+ Year Member



AJAX: Use javascript for the asynchronous request, PHP to serve the content, then again javascript to place it in the container block.

If you don't mind refreshing the page, there is no secret. Just create your template, put the corresponding content within the container block of the template, and output the template.

include() wouldn't make sense for this particular case since you want to change the content, not the code.

penders

6:55 pm on Oct 30, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Or do you even need to use AJAX? All the text (providing there's not too much of it) could be present in the initial document and you just display the appropriate snippet with JavaScript - better for accessibility and SEO (given that you are concerned about the disadvantages of iframes).

sssweb

8:30 pm on Oct 30, 2011 (gmt 0)

10+ Year Member



Thanks, I'll look into those.