Javascript libraries

Conventions

Much of the Zcore code uses custom javascript, usually in zeprs.js or one of the dwr-related files. Zcore is moving towards using JQuery and aligning our Javascript efforts with the folks developing OpenMRs. There are some useful Javascript primers on the OpenMRS website:

Selecting Javascript Libraries

If you need to be selective about which Javascript library you use, add the following to the template:

        <c:if test="${! empty dojo}"><script type="text/javascript" src="/${appName}/js/dojo.js;jsessionid=${pageContext.request.session.id}"></script></c:if>
        <c:if test="${! empty jquery}"><script type="text/javascript" src="/${appName}/js/jquery-1.4.2.min.js;jsessionid=${pageContext.request.session.id}"></script>
        <script type="text/javascript">
            var $j = jQuery.noConflict();
        </script>
        </c:if>

In your jsp add the following:

<c:set var="jquery" value="1" scope="request"/>