Getting full HTML source of HR.Net form/workflow

HR.Net is working through web-browser and in the background it is plain html pages with javascript.
In the latest versions of HR.Net we have ability to put in our JavaScript into screens and workflows. And sometimes it is useful to see what HTML code is actually on the page.
To output HTML source code do the following: on the required screen place a field of type Memo. Give it a proper name. Then open Custom Script dialog for that screen an put there the following code:

$HRnet("MEMO FIELD NAME").setDisplayValue(document.body.innerHTML);

Replace “MEMO FIELD NAME” with the name of the memo field you have created.
Next time you open this screen, you will have the entire html source of the page loaded, where you can review the structure and develop further JavaScript. This technique allowed me to do much more stuff on the screen and enhanced interaction with a user.

Enjoy.

p.s. as Vicas says you can also do this:

var popup=window.open();
popup.document.open("text/plain").
               write(document.documentElement.innerHTML)

or

var popup=window.open();
popup.document.open("text/plain").
               write(document.documentElement.outerHTML)
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

6 Responses to Getting full HTML source of HR.Net form/workflow

  1. Julien says:

    Has been sooo useful to me,
    Thanks a lot

  2. vikas says:

    found the same trick myself few days back. Another better approach :

    var popup=window.open();
    popup.document.open(‘text/plain’).write(document.documentElement.innerHTML)

    or

    var popup=window.open();
    popup.document.open(‘text/plain’).write(document.documentElement.outerHTML)

  3. vikas misra says:

    Just paste above code in screen/form script editor

  4. admin says:

    That looks quite neat. I’ll try that next time I need it.
    Thanks)

  5. Dan Hutson says:

    What is the difference between inner and outer HTML?

    • admin says:

      Here is some interesting text

      innerHTML= The HTML contained by a tag.
      outerHTML = The HTML of a tag, including the tag itself.

Leave a Reply

Your email address will not be published. Required fields are marked *