Javascript output in the source files? [closed]

What you want to do is not possible in Javascript.

If you want to have the content in the source for SEO purposes, you need to render it server side. So if the site is built on PHP and Javascript, build it in PHP.
You can do it in Javascript if you have server side Javascript running (e.g. Node.js), but I’m guessing this is not the case.

The client side Javascript runs in the browser and only when the document is loaded. Ajax is a Javascript technique to do an extra request in the background to get extra content. This won’t help you in this situation, because search engines won’t run this Javascript, so they won’t have the dynamically loaded content.

If you want to know what Google indexes, disable Javascript in your browser and see what is left of your page. That is what search engines see, nothing else.

If that means you have to translate setClockMulti to PHP, so be it. It’s probably easier than installing Node.js. If you need help translating it, I guess you can ask a new question describing your exact problems.

Browse More Popular Posts

Leave a Comment