Solved

Define Variables to use in Template in SEO Friendly Way

Posted on 2013-01-27
3
217 Views
Last Modified: 2013-01-29
I am using a restrictive shopping cart that has limited options for customization.
Basically what I'm trying to do is define a string of text within an individual product description and then use that text within the product template in any way that I want.

I am currently doing this with a JS variable and then using document.write to print it to the page. That works perfectly, but I am worried that Yahoo/Bing won't be able to index that content properly. Would using Jquery's .append to a DIV be any better? Should I define this content within a DIV somehow to be used later? I don't want to be penalized for hidden or duplicate content.
What is the best, most SEO friendly, way to do this? Thanks!!

Product Description:

<script>
var test = "Test text string.";
</script>

Open in new window

Product Template:

<script>
document.write(test);
</script>

Open in new window

0
Comment
Question by:lowpriceskates
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
Comment Utility
What you are doing is not optimum but it sounds like it is all you can do.  With that, I would continue.  I have seen mixed reports but I trust the findings here  http://www.seomoz.org/ugc/can-google-really-access-content-in-javascript-really
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
var test = "<div>Test text string.</div>";
for a string with a linefeed.
var test = "<span>Test text string.</span>";
For a string without a linefeed

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
Google CAN detect document.write if it is in the body, but not if it is run from a function: though it will not necessarily penalize for it unless there is an excessive number of keyword phrases which it will consider as tuffing, and then you get hammered big time.

Cd&
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now