Welcome to WebmasterWorld Guest from 107.20.5.156

Forum Moderators: open

Message Too Old, No Replies

Using Javascript to write repetitive content - SEO compatability

     

PSWorx

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

10+ Year Member



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

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

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



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

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

10+ Year Member



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

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

WebmasterWorld Senior Member 5+ Year Member



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

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

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

WebmasterWorld Senior Member 5+ Year Member



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

Whoa! Very dangerous! Do not do that.

rocknbil

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

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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

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

WebmasterWorld Senior Member 5+ Year Member



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]

 

Featured Threads

Hot Threads This Week

Hot Threads This Month