Okay to have text in javascript?
-
There are so many conflicting opinions out there, one of which I recently read indicated that if you are putting your keywords in javascript, the new google update would have an issue with this.
If you want to keep a page clean looking and have visitors click to read more text, is the opinion here that this is okay or an issue? The main purpose of adding text in javascript would be to have enough content on the page without making it look cluttered.
Webmaster tools says that when you have hidden text in javascript, the same content should be placed in a no script tag?
Thanks.
-
The client wants to remove existing content to create a cleaner look on the page. I suggested we find a way to keep that content to avoid losing the traffic it generates and turning the page into a low quality page. My thought was to display a portion of the content and have the visitor click to view the rest.
-
What I've found is that it is okay to have text in JavaScript and Google/Bing will probably index that content if the JavaScript is not too complex. I've seen it not index more intense JavaScript or scripts that require user interaction. You can put alternative text in noscript tags and that seems to work okay.
Typically though, I recommend putting the super important optimized text in regular old HTML instead of JavaScript. That way you are 100% certain that Google/Bing can crawl and index that content. Plus, it is typically easier to manage content in HTML.
However, what you said about the clutter makes it sound like your JavaScript is adding effects to text already in the HTML. Is that the case? For example, you have a div on your page that contains some text. By default, it has the style attribute "display:none;". When a user clicks or takes some action, you change that display attribute to shows previously hidden text. Is that what you are doing?
If that is what you are doing, or something like that, then you have text in HTML not JavaScript. One easy way to check this is to disable CSS and JavaScript then load your page. You want to make sure you can see the content you want Google/Bing to index.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Is this method of redirecting of 404 okay?
Hi all, This is my first post at this forum 🙂 I'am running a Opencart shop with a SEO extension installed. This extension has a redirect module which works like this. When visiting the site on 404 url (and if there is setup a redirect for that url). It serves the correct content but on the 404 url with the correct url set in rel canonical. For example: Try visit this url:
On-Page Optimization | | mrmagnecom
https://makitech.no/ventilasjon/ventilasjons-pakketilbud
Here i have setup a redirect to the correct content, which is actually this url https://makitech.no/pakketilbud I am used to use a 301 header redirect so the user get redirected to the correct url. So my question is this. Is it a okay practice to serve the content on the 404 url (it responds 200) when the correct url is set in canonical? Any thoughts?0 -
Does Bolding Text Have Any Impact on SEO?
Someone told me it does but I thought that was old school way of thinking. Any thoughts?
On-Page Optimization | | tryfantasy1 -
Is thumbnail text crawlable/lists of product names considered as normal copy in terms of keywords?
On a page that lists products (thumbnail text repeating the same word when you sell variations of the same thing) and also has copy at the bottom, are the product names crawlable? Is it better to avoid repeating the keyword in the copy? Can you get penalised for it?
On-Page Optimization | | LawrenceNeal0 -
Link anchor text in list menus
Obviously Google likes descriptive anchor text. At least the first version on the page. But suppose you had a list of scrap yard depots on a hover site menu, would you go for the person friendly nested list, so Scrap Yard Depots Newcastle Chester Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch Or the presumably more Google friendly; Scrap Yard Depots Newcastle Scrap Yard Chester Scrap Yard Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch Scrap Yard
On-Page Optimization | | JamesFx0 -
Main navigation with pictures & Alt Tags vs Text/ Link based Navigation
Hi, do I loose an opportunity to rank better if I use a navigation with Alt-tagged Pictures in comparison to a Text/ Link based main navigation? Thanks, Sebastian
On-Page Optimization | | Naturalmente0 -
Are Content in Inline Javascript and Collapsible Considered Cloaking to Google?
Hi, I would like to save space in my website and do not want my other products to be pushed down below the first fold. In order to do that, I have decided to add content inside inline javascript or using collapsible. For collapsible, I may be using "show/hide" button or "read more" button to show the whole content. So does content in Javascript and collapsible considered hiding from Google? If it is, then I have to think of other options. Thanks.
On-Page Optimization | | globalsources.com0 -
On site optimization - anchor text in body text
Hi I am learning SEO from scratch and am only a couple of weeks in. My wife has just started a website selling children clothes. In the left bar there are links to the different producers. Clicking it takes you to the products from that producer. In the body text om the main page ( epleskrinet.no) the same producers are mentioned. By time i need to opitmize for all of these. Is there any point in making them anchor text - taking them to the same URL as is given in the side bar ? Or will it get discounted ? Dan Laerum
On-Page Optimization | | danlae0 -
Anchor text, same page, different kewords to same URLs
Could someone please tell how Google treats the use of anchor text from a single page when using different keywords that all point to the same URL. So for instance I am doing a blog post and use the following anchor text which all point to the same URL: Cool Widget >> www.domain.com/widget Awesome Widget >> www.domain.com/widget Mighty Widget >> www.domain.com/widget I have read that Google will only take noticeof the first one? Thanks
On-Page Optimization | | blagger0