-1

Question: is it possible to implement SEO with client-only Single Page Application?

Topic: I'm implementing a REST application that is not based on a specific server architecture. So i've to implement a SEO without using techniques of "server side static rendering/snapshots"...is there a way to do it using only javascript+html5?

summarizing: javascript & html5 - no server-side = is SEO possible?

here you are a "concept code for this app"

<head>
    <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
    <script src="myApp.js"></script>
</head>
<body>
    <div id='head'></div>
    <!-- extra html code here -->
    <div id='content'></div>
    <!-- extra html code here -->
    <div id='footer'></div>
    <script type="text/javascript">
        var page=myApp.getPage(); // get current page name from url fragment
        $("#head").load("pages/"+page+"-head.html"); // load html for head div
        $("#content").load("pages/"+page+"-content.html"); // load html for content div
        $("#footer").load("pages/"+page+"-footer.html"); // load html for footer div
        myApp.loadContent(); // get contents from REST APIs and load inside html
    </script>
</body>

EDIT: i'm not asking if google crawlers can render js code, but: if is there a way to implement SEO for most search engines in my context. The answere , however, after some reasearch is that actually there are no techniques to do it ( except some pre-rendering enterprise services that creates html snapshots for you ). Seems that the only solution ATM is waiting a better js support for search engines crawlers in future.

2 Answers2

2

The fact that there is no specific server script doesn't really matter. A search engine crawler is a client, and all that matters is the content that it gets, regardless whether that content is static or dynamically generated.

That said, if your page is completely built with JavaScript, that sure does matter. If it's one big page that is presented as different pages through JavaScript, a search engine might still index it as a single page, or not at all.

Google supports JavaScript nowadays, but it is still experimental, and most other crawlers still don't support it. Generally it's a good idea to disable JavaScript in your browser and load the page, then you'll see what the crawler sees.

GolezTrol
  • 114,394
  • 18
  • 182
  • 210
  • as you can read i'm developing a [single app page](http://en.wikipedia.org/wiki/Single-page_application) that load its "subpages" dynamically via javascript. So disabling javascript you can't see nothing of the content. Just an empty template – Giuseppe Ronca Dec 06 '14 at 16:27
  • I know what single page means, thank you. A single page app can have static content as well, and even can have everything pre-loaded (which is mentioned as well in the Wikipedia link you gave). Anyway, I've described what happens in that case in the answer, but to be extra clear: your completely dynamically loaded empty-without-JavaScript page *might* be indexed by Google and *won't* be indexed by other major search engines. The only thing you can do about that is to make sure the page has proper content as well in a non-JavaScript situation. – GolezTrol Dec 06 '14 at 16:29
  • thank you for "extra-clearification" , however i'm trying google webmaster tools to check google indexing and seems that google can't render my dynamic content. Maybe i've to do some extra work – Giuseppe Ronca Dec 06 '14 at 16:51
-1

Sure, it is possible.

Google SEO robots (googlebot) can run your JS and "see" the page as it should be on modern browsers, so then they can scan the DOM of your page, no matter how it is created (server side or client). If your JS is standard, search engines will be able to read your page as users.

So you can use all your SEO knowlage on building it with jquery .load() method.

SOURCE: http://googlewebmastercentral.blogspot.ca/2014/05/understanding-web-pages-better.html

MQ87
  • 1,008
  • 1
  • 13
  • 30