Develop > Tailoring > Web tier > Example: Running custom JavaScript from the Web client

Example: Running custom JavaScript from the Web client

This example runs a JavaScript during the Web client onload.

  • The script opens an alert window before loading the Web client
  • The script returns to the Web client when the user clicks OK.
  1. Log on to the Web tier system.
  2. Stop the Web tier Web application server.
  3. Browse to the ext folder of your Service Manager Web tier's context root. For example, sc/ext.
  4. Open the Java Server Pages (JSP) file named appheader.jsp in a text editor.
  5. Search for the following text:
    <script type="text/javascript">
  6. Add the following entries to the appheader.jsp file just after the script element:
     document.onload = init();
      function init()
       alert("Testing document.onload from appheader extension./n Press Ok to continue with navmenu application.");
  7. Save the appheader.jsp file.
  8. Clear your Web application server's cache.
  9. Restart your Web application server.
    The Web client now runs your custom JavaScript when the Web client starts.

Related tasks

Branding the web client