Solved

Define Variables to use in Template in SEO Friendly Way

Posted on 2013-01-27
3
220 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
ID: 38825191
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
ID: 38825395
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
ID: 38825412
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

895 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

13 Experts available now in Live!

Get 1:1 Help Now