I have created custom CQWP web part in which i am sliding news contents. I have created structure for sliding contents. Now i want to add JQuery file reference in my CQWP web part but it gives error while adding reference in Mainfile of CQWP.

I have tried this code but it gives error..

<xsl:template match="/">
        <xsl:value-of disable-output-escaping="yes" select="string('<script src=&quot;/SiteAssets/jquery-1.9.1.min.js&quot;></script>')"/>
        <xsl:value-of disable-output-escaping="yes" select="string('<script src=&quot;/SiteAssets/jssor.js&quot;></script>')"/>
        <xsl:call-template name="OuterTemplate"/>

Please help to how to add external script reference in CQWP web part?

1 Answer 1


Following snippet can be used to reference the jQuery in your XSLT webpart.

Inline Script Block:

<xsl:text disable-output-escaping="yes"> 
        <script type="text/javascript"> 
            (your JavaScript code here) 

Script Reference Block:

<xsl:text disable-output-escaping="yes"> 
        <script type="text/javascript" src="/SiteAssets/jquery-1.9.1.min.js"></script> 
  • 1
    Thanks @Predip.. It works like a charm...!! Thank you so much..!! Commented Jul 10, 2015 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.