hi guys, is there any possibility to use each div as individual frames and load them without loading the entire page...... For e.g. <frameset> <frame id="smenu" src="1.htm"> <frame id="content" src="2.htm"> </frameset> is this concept possible with div ....
Yes. It is possible with Javascript/Ajax. The ajax approach is slightly more difficult, since you need to know PHP, ASP or something similar to use it. So I'll stick with the simple Javascript approach (not SEO friendly though). Create HTML Page and stick a div and a link between <body> and </body>: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Load Content By Javascript</title> </head> <body> <!--Div to load content into--> <div></div> <a href='#'>Load Content</a> </body> </html> Code (markup): Give the div you wish to load content into a unique id: <!--Div to load content into--> <div id="content"></div> Code (markup): Now for the Javascript part. Basically you need a simple function that loads a variable into the div. Put the follwing code into your head section. <script type="text/javascript"> <!-- function loadContent(content){ //Load the content into the div document.getElementById("content").innerHTML=content; } --> </script> Code (markup): Now, to load the div content when you click a link. You need to add an onclick attribute to your link: onclick="loadContent('')" Code (markup): Between the single quotes in - loadContent('') - place what you desire to be loaded. For example: loadContent('Hello') will make the div's content "Hello". I made a little example: http://bezdredge.net/Examples/Javascript_Content/main.html Note I have not used external stylesheets or scripts - not the right way to do things, I was just in a hurry, and had minimal styling and Javascript to worry about.
No, it's not. DIV is an HTML element, and the alternative that blueparukia requires JavaScript. Why not just use a server-side include or a server side programming language's include function to do what you want? (See the second link in my signature for details.)
There's actually a few different ways to do it with pure HTML/CSS. I have posted one method here previously. I got flamed because the code was not "semantic". It works in all browsers and passes code validation. It employs the limited targeting properties of the id. I'll not post it again to avoid starting another flame war. The second method is to employ the "object" tag and this also requires the use of the id type container's targeting properties to emulate a frame. It's not semantic, either. It's the same as the above method except the content is stored in external HTML files. The third method employs the use of the "content" attribute in a class statement. This is certainly not semantic because you author content in the stylesheet, similar to the use of a background image in a container. A 4th method employs the iframe element and a different doctype. Now you're just doing frames again, bad for SEO, but it's perfectly legal HTML and the browsers all parse it correctly. You can Google these methods up and see which one works best for your situation.
^^ But why bother with all that? Just write a script in PHP to retrieve the contents of an external file, and call the script by ajax. There will still be SEO issues - its not really possible to avoid them when using things like this..
I don't see why there would be SEO issues if there's simply a server feeding in HTML to a page (generated content). The browser sees normal HTML and doesn't know whether it's static or not. Hence, neither do the googlies. They merely go to a site and see the presented HTML and CSS. RIght?
Using Javascript/Ajax though, the HTML output does not show up in the source. Which is wy using server side is till the best way to do things.
All of my script generated content indexes just fine, but then I don't use javascript. I use HTMLscript and dynamic content stored in a MySQL database. I haven't seen any indexing problems with PHP content, either. They don't see the scripts, they see the output.
try overflow div.classname { overflow: scroll; width: 200px; height: 200px; } it looks like a frame, but its not. its the closest thing that divs can act like a frame.
^ I see what you mean here, but the "frame" behaviour that the OP wants is the ability to have chunks of content stuck on a page at will (like frames did). A "fake" CSS frame as far as scrolling behaviour on the page looks like a frame, but doesn't have anything to do with generated content being added dynamically to a page, or to keep the same header and menu and footer of a website while only refreshing/reloading the middle for example, instead of the whole page. It can make for faster loading, esp. for dial-up users.