miércoles, 29 de mayo de 2013

Get final HTML markup of a JavaScript application using rhino - envjs

This article briefly describes how to dump the final HTML markup of any web site using serverside tool rhino-envjs. We will work into the release root folder so "cd" to it.

step 1 - download latest envjs release (as this writing 1.2) and uncompress it.
step 2 - download ant and run "ant" on the previously uncompressed envjs folder. This should build envjs. step 3 - create the file test1.js with the following content: 
load('dist/env.rhino.js');
var url = "http://jquery.com"; 
window.location = url; 
print(document.innerHTML+"");
step 4 - in a shell enter the following command:
java -cp rhino/js.jar org.mozilla.javascript.tools.shell.Main \
  -opt -1 test1.js > test1.html

If everything was fine you can open the generated file test1.html with firefox and see the jquery generated markup, not a very visual replica but often useful for SEO and those. For each JavaScript error a Java exception will be printed on stderr.

In my case this is useful for 100% JavaScript web applications SEO support.

16 comentarios:

Anónimo dijo...

Furthermore when your highly electric source fails, you still carry a very back-up.



Feel free to surf to my web site; zespół muzyczny Poznań

Anónimo dijo...

Try to commit enough space regarding each of these kind of in their quarters.
Men or women are not incredibly used to searching something new.


Also visit my web page :: zespół muzyczny Toruń

Anónimo dijo...

Down Wares- Mug is the typical item to do this category. To make example, you
may learn how to better target your visitors or who another prerequisite should be.



my homepage :: tanie wczasy

Anónimo dijo...

Any gardener needs suitable tools to try cutting
and trim plants, bushes and roses. Dinner is served at its a real four-star restaurant,
the very Metate.

Feel free to visit my web-site - tanie wczasy nad morzem

Anónimo dijo...

Pick up a atlas at City Space and check the city's self-guided early walking tour. These rental homes will bring a huge home-away from-home need in you.

my webpage - ochrona przeciwpożarowa

Anónimo dijo...

Texas hold'em Edge is like your private Colorado Hold 'Em Online poker coach.
What should you do if you along with the decision creator?


Feel free to visit my weblog :: candida

Anónimo dijo...

It hosts visiting tourist from all over that world in luxury hotels, apartments and bungalows.


My web site :: candida

Anónimo dijo...

Congratulations, you may already learn about affiliate programs,
accomplishing work or making some money online.

Have a look at my blog; candida

Anónimo dijo...

Isometric exercises and resistance help strengthen the body in preparedness for a
fight. Thus security plays greatest role in completely
fields.

my web-site - historia piwa

Anónimo dijo...

These was the precept we used when we developed our favorite universal roulette tool.


my blog post :: historia piwa

Anónimo dijo...

Music licenses contrast by company over acceptable and unpleasant royalty free take.
You can fine-tune the volume according to your aim to
any range you like.

My blog :: historia piwa

Anónimo dijo...

Insane Clown Posse hails from Detroit, which is neither of these methods.
Its history of Indian music is especially old just like the nation's history.

Feel free to surf to my blog ... wycieczki last minute

Anónimo dijo...

In this case consider detoxification protocols several
years before an computer program is submitted. All those pains are primarily due to incredibly low blood
circulation.

Also visit my webpage :: wycieczki last minute

Anónimo dijo...

Fiji, an islands of islands found in the South Pacific, consists of over 322 hawaiian islands.


my weblog :: www.biorezonans-warszawa.pl

Anónimo dijo...

Amazіng thingѕ hеre. I am vеry glaԁ to look your article.

Thаnks a lot and I am taκіng a look ahead to tοuch you.
Will you pleaѕe droρ mе a mail?


Reνiеω my web blog :: loan company

Unknown dijo...

I've tried your example and it brings the very same source page just like no actual processing (JavaScript) had been done and ajax calls never invoked. Does this actually work? Any suggestions on what I might do wrong? Thank you.