Jump to content

I need several panels, should I use <div>'s and AJAX?


judacoor

Recommended Posts

Hello to all!I building some sort of a web application, which needs to have a lot of panels, kinda like a navigation panel to the left, another one in the middle, and an extra one on the right. It also has two smaller panels where I intend to place the buttons each panel needs for the app to work in a confortable way.So I'm trying to decide on what method to use...I've started having a <div> to represent each panel; and I change their innerHTML with a XmlhttpRequest using AJAX, and it seems to work ok, but seems waaaaaay to long to finish....So I was just wondering if any of you guys could tell me the pros and cons about using this method, or if you know some other way I'm open to suggestions!!Thanks a lot!

Link to comment
Share on other sites

Well... you definitely should use divisions unless your layout is very complex, then use tables. But divisions render faster.Umm... using AJAX? Well, if you do use it then your pages should load quite fast, as only the content pane will have to reload. However, your pages would not be indexed by most search engines as their robots can't run AJAX scripts.The alternative, I suppose, is using PHP to pre-process the pages with seperate content, header, and footer files in a kind of

<?php	include("header.php");	//Content goes here	include("footer.php");?>

way. This will take slightly longer for the browser to load, and navigation will be slower, but you will have a higher SE ranking and users without JavaScript (less than 2% of viewers) will also be able to view your webpages.So, I suppose it is up to your priorities for your website :) Hope that helped

Link to comment
Share on other sites

Gotcha!but since the application i'm trying to build will be sold for a monthly fee, I don't need it to be in the top lists of search engines.....so i'm guessing it should not be a problem to continue down the <div>'s path......right?

Link to comment
Share on other sites

div's do not keep you from being indexed. In fact they are better for seo than tables. It is javascript/ajax content that can't be indexed. Even though this is paided service you will still want people to search and find your service. Unless of course you have another primary marketing source but orangic traffic is great, and it's free!

Link to comment
Share on other sites

AJAX boils down to applying the XMLHttpRequest, as I started to master 14 hours ago. In fact, you're loading specific information into a div, be it from a textfile, an HTML file or from a database via serversided scripting. The page is requested via clientsided scripting, known as JavaScript (or ECMAscript as it's being standardized).That doesn't change how markup, content and style are separated with their own language: CSS for style, serversided scripting to provide content, and HTML to let it all work together without defining any style or content. As you add clientsided scripting to get that content on screen without refreshing the page, that's where AJAX comes in.I don't know how search engines work. Most are known to fetch data from meta tags in the head of HTML files. Google tends to search for pages with a valid doctype declaration (the famous W3 DTD file). I believe Google stores all data contained within or loaded by an index file with a valid doctype declaration, be it AJAX-enabled or not.At least that's how I experience it. Doctypes tell you're complying with certain standards, which makes Google believe you're a professional hired to speak on behalve of a content provider, and your content is reliable.AJAX only lets you use a div as if it were an iFrame, but then a bazilion times more friendly to implement. It doesn't affect traditional webdesign in any way, instead it enhances it and encourages you to use web laguages the way they're intended.If you want to excuse me now, I downed a proper amount of booze and are about to crashdive into my bed right now. (I live in Europe, so 6 to 8 hour time lag at least)

Link to comment
Share on other sites

My only suggestion on this subject is you should first build a workable application WITHOUT Ajax. Then, once you've got that working well to your liking, feel free to allow for Ajax scripts. Your website should be friendly for ppl whom are paranoid and dont have Javascript enabled for whatever reason, and for people who know what javascript does and AREN'T paranoid. Javascript is great, but you have to have a way for people to see your site, right? and you want(i dont care who you are, you always want) for Search engines to cache your page and give you a search results for whatever you're doing. After all, visits equates to money in the internet business world.

Link to comment
Share on other sites

I don't know how search engines work. Most are known to fetch data from meta tags in the head of HTML files. Google tends to search for pages with a valid doctype declaration (the famous W3 DTD file). I believe Google stores all data contained within or loaded by an index file with a valid doctype declaration, be it AJAX-enabled or not.
The problem with search engines is, say, you have a AJAX-powered page with a body that looks like
<body onload="loadcontent(); "><div id="content"></div></body>

While users' browsers will run the AJAX scripts and load the page, all search engines will see is an empty document, and give it a very low ranking.Of course, one way to get around this is to get the users of your service to type descriptions of their sites, which then go in a META tag like so:

<META name="description" content="description goes here" />

Therefore, when search engine robots view the page they will index the description instead of the body text.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...