Introduces post-hook.

Post hook can be used to directly return and execute
JavaScript.
Added JavaScript console option.
Translation string for the JS label.
Align the error types.
Drop closing PHP tags.