protected void appendJsNode(HttpServletRequest request, Document document, DocumentFragment head, Js js, String relativeRoot) {
        final String scriptPath = getElementPath(request, js, relativeRoot);

        if (resourcesDao.isConditional(js)) {
            Comment c = document.createComment("");
            c.appendData(OPEN_COND_COMMENT_PRE);
            c.appendData(js.getConditional());
            c.appendData(OPEN_COND_COMMENT_POST);
            c.appendData(OPEN_SCRIPT);
            c.appendData(scriptPath);
            c.appendData(CLOSE_SCRIPT);
            c.appendData(CLOSE_COND_COMMENT);
            head.appendChild(c);
        }
        else {
            Element element = document.createElement(SCRIPT);
            element.setAttribute(TYPE, "text/javascript");
            element.setAttribute(SRC, scriptPath);
            element.appendChild(document.createTextNode(" "));

            head.appendChild(element);
        }
    }
protected void appendJsNode ( HttpServletRequest request , Document document , DocumentFragment head , Js js , String relativeRoot ) { final String scriptPath = getElementPath ( request , js , relativeRoot ) ; if ( resourcesDao . isConditional ( js ) ) { Comment c = document . createComment ( "" ) ; c . appendData ( OPEN_COND_COMMENT_PRE ) ; c . appendData ( js . getConditional ( ) ) ; c . appendData ( OPEN_COND_COMMENT_POST ) ; c . appendData ( OPEN_SCRIPT ) ; c . appendData ( scriptPath ) ; c . appendData ( CLOSE_SCRIPT ) ; c . appendData ( CLOSE_COND_COMMENT ) ; head . appendChild ( c ) ; } else { Element element = document . createElement ( SCRIPT ) ; element . setAttribute ( TYPE , "text/javascript" ) ; element . setAttribute ( SRC , scriptPath ) ; element . appendChild ( document . createTextNode ( " " ) ) ; head . appendChild ( element ) ; } }
Convert the {@link Js} argument to an HTML script tag and append it
to the {@link DocumentFragment}.