Load script with parameters

Posted by Doseke on Stack Overflow See other posts from Stack Overflow or by Doseke
Published on 2012-11-09T04:54:54Z Indexed on 2012/11/09 5:00 UTC
Read the original article Hit count: 162

Filed under:
|
|

Before I used .jsp pages for jsf, and the below code was pretty fine

<script language="javascript"
    src='<%= renderResponse.encodeURL(renderRequest.getContextPath() 
        +"/resources/jsCropperUI/scriptaculous.js?load=effects,builder,dragdrop") %>' >
</script>

Now, I'm using .xhtml with RichFaces, and the below code does not work

<a4j:loadScript src="/resources/jsCropperUI/scriptaculous.js?load=effects,builder,dragdrop"/>

Exception is

Static resource not found for path /resources/jsCropperUI/scriptaculous.js?load=effects,builder,dragdrop

How can I fix this?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jsf