The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. On-Page / Site Optimization
    4. Content within JavaSccript code

    Content within JavaSccript code

    On-Page / Site Optimization
    6 5 1.0k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mjmorse
      mjmorse last edited by

      I know that it is not a good practice to inlcude SEO content within JavaScript, but are there exceptions to what Google can spider or is it best to just avoid completely?

      1 Reply Last reply Reply Quote 0
      • DanDeceuster
        DanDeceuster last edited by

        A simple javascript that does something like document.write is fine. Google can execute a lot of javascript now. The key is to to webmaster tools and fetch the page as googlebot. Then you can see what Google can see on your page. If you have SEO content in a javascript and Google cannot see it, I would change it. If Google can see it and index it just fine, no problems.

        1 Reply Last reply Reply Quote 0
        • Guest
          Guest last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • G-Force
            G-Force last edited by

            Hi Mjmorse,

            What do you mean by SEO content? Do you mean that your content is only targeted for search engine spiders?

            In case your content is also targeting the actual real users that will visit your website, I suggest you avoid javascript for content in case some of them are using mobile device with limited javascript support.

            Plain text content right in the HTML is always preferable over dynamicaly loaded content from JS. Using javascript is usualy a way to hide content to search engines, not the opposite.

            Best regards,
            Guillaume Voyer.

            1 Reply Last reply Reply Quote 0
            • RyanOD
              RyanOD last edited by

              From my perspective, whenever possible you want to make your JavaScript content degrade gracefully. Basically, if a visitor has JavaScript turned off, they still have access to the content they would see if JavaScript was turned on. This also eliminates the need to worry about whether searchbots can or cannot spider such content.

              As an example, consider a JavaScript based image carousel. With JavaScript turned on, the user can cycle through the images in a (usually) user friendly way via the carousel controls. With JavaScript turned off, the user can still see the images, but may have to click on them to see them displayed in the browser window - not as slick, but not bad either.

              One key aspect to this type of development is writing well organized markup / code / scripts that allows for your JavaScript to be seperated from your HTML.

              A great resource for learning about this is DOM Scripting by Jeremy Keith.

              1 Reply Last reply Reply Quote 0
              • mjmorse
                mjmorse last edited by

                Thank you for the quick responses.

                Thanks,

                Matthew

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                • Does javascript generated content consider as regular content?
                  Expansyon
                  Expansyon
                  0
                  2
                  25

                • Automated checking for broken links within content pieces
                  Martijn_Scheijbeler
                  Martijn_Scheijbeler
                  0
                  4
                  99

                • Is it better to create more pages of content or expand on current pages of content?
                  TWSI
                  TWSI
                  1
                  3
                  67

                • Content with changing URL and duplicate content
                  Christian_T
                  Christian_T
                  2
                  6
                  108

                • Pagination on related content within a subject
                  Dr-Pete
                  Dr-Pete
                  0
                  2
                  82

                • Static content VS Dynamic changing content what is best
                  DoRM
                  DoRM
                  0
                  5
                  270

                • Checking for content duplication against content on your own site.
                  CleverPhD
                  CleverPhD
                  0
                  10
                  483

                • Blog content on homepage - Dupe Content Penalty?
                  KeriMorgret
                  KeriMorgret
                  1
                  6
                  956

                Get started with Moz Pro!

                Unlock the power of advanced SEO tools and data-driven insights.

                Start my free trial
                Products
                • Moz Pro
                • Moz Local
                • Moz API
                • Moz Data
                • STAT
                • Product Updates
                Moz Solutions
                • SMB Solutions
                • Agency Solutions
                • Enterprise Solutions
                • Digital Marketers
                Free SEO Tools
                • Domain Authority Checker
                • Link Explorer
                • Keyword Explorer
                • Competitive Research
                • Brand Authority Checker
                • Local Citation Checker
                • MozBar Extension
                • MozCast
                Resources
                • Blog
                • SEO Learning Center
                • Help Hub
                • Beginner's Guide to SEO
                • How-to Guides
                • Moz Academy
                • API Docs
                About Moz
                • About
                • Team
                • Careers
                • Contact
                Why Moz
                • Case Studies
                • Testimonials
                Get Involved
                • Become an Affiliate
                • MozCon
                • Webinars
                • Practical Marketer Series
                • MozPod
                Connect with us

                Contact the Help team

                Join our newsletter
                Moz logo
                © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                • Accessibility
                • Terms of Use
                • Privacy