homepage Welcome to WebmasterWorld Guest from 54.226.235.222
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Using Javascript to write repetitive content - SEO compatability
PSWorx




msg:3520917
 2:31 pm on Dec 5, 2007 (gmt 0)

It was brought to my attention that it would be possible to use javascript to include content such as menus and metatags for example where this content is repeated however how would this affect SEO compatability, would a search i.e. google be able to see the menu links which would be document.write'n into the menu container of the layout and the same for the metatags.

The reason for this is i am trying to avoid having to copy and paste amended menus into 15+ static html pages for a new site i'm doing which primarily won't be using any form of ssi (php).

If anyone can shed more light on this situation that would be great.

TIA

 

Fotiman




msg:3520936
 3:05 pm on Dec 5, 2007 (gmt 0)

Search engines will NOT see links that are created with JavaScript. So that is a bad option.

If you give your files a .shtml extension, you should be able to use regular server-side includes (without using PHP). That would be the best option.

PSWorx




msg:3520961
 3:51 pm on Dec 5, 2007 (gmt 0)

I havent used the shtml file type and those type of html includes also im not entirely sure if my free server will accomodate for it, i will do some research and see what will be the best option.

After a bit of thought earlier i will probably need to use php as my administration system is built in this lang however i need to heavily modify it to version 2.

Thanks for your time.

Dabrowski




msg:3521068
 5:58 pm on Dec 5, 2007 (gmt 0)

I have used .shtml files, or SSI. It's fairly basic and your server *should* support it.

Basically, in your .shtml file include this line:

<!-- #include virtual="/myfile.inc" -->

Where myfile.inc is the name (with full URL) of the file to 'paste' into your HTML. It doesn't have to be called .inc, I just use it so I can distinguish between files on my own server.

I belive that search engines prefer this to PHP, as they consider it to be more stable content. Don't know for sure, and I'm sure for everyone who would agree, someone would disagree.

I use it all the time for exactly what you need, headers, footers and menus.

Chris.

johnblack




msg:3521087
 6:12 pm on Dec 5, 2007 (gmt 0)

Using #include is probably the best solution. However if that's not available to you, does your html editor have a find and replace function that will execute across a whole site?

I use this kind of functionality all the time in Dreamweaver for a quick, site-wide amendment.

Dabrowski




msg:3521093
 6:16 pm on Dec 5, 2007 (gmt 0)

have a find and replace function that will execute across a whole site?

Whoa! Very dangerous! Do not do that.

rocknbil




msg:3521179
 8:30 pm on Dec 5, 2007 (gmt 0)

such as menus and metatags for example where this content is repeated however how would this affect SEO compatability.....

Actually, let's consider for a moment - in the case of menus, wouldn't this be a good way to avoid duplicate content penalties?

You would of course have to have hard-coded plain text links for the initial menus, but in the context of SEO, because JS links are ignored it might be an option to consider.

Dabrowski




msg:3521246
 10:34 pm on Dec 5, 2007 (gmt 0)

In case of menu's, to hold it against you I think G would have to:

Have got out of it's tree house the bed on the wrong side...
Fallen through that annoying hole in the floor...
Hit every 'bad day' branch on the way down...
Landed in another bed...
Then got out of the wrong side of that one too.

...

Then trodden in poo on the way to it's campervan...
Been stuck in traffic on the way to the office...
Got out of the wrong side of the campervan...
To find the coffee machine broken.

[edited by: Dabrowski at 10:47 pm (utc) on Dec. 5, 2007]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved