You must Sign In to post a response.
  • Category: XML

    How to use jquery in xsl file

    Hi

    I want to implement jquery to change style in xsl,

    I'm using following function, but it is not workin


    Any suggestions will be of great help.

    <script=text/javascript src="..... url og jquery" defer="true">
    <![CDATA[
    $(document).ready( function() {
    alert("test");
    $('.para_left').css({ margin-top: 0px !important });
    });

    ]]>
    </script>

    Thanks in advance
    Sharon
  • #754671
    Try the Inner HTML for para tag as



    <script=text/javascript src="..... url og jquery" defer="true">
    <![CDATA[
    $(document).ready( function() {
    alert("test");
    $('.para_left').html(<p style="margin-top: 0px !important" >);
    });

    ]]>
    </script>


    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM

  • #754680
    You need to use value into your page HTML (e.g. in data attributes) which JavaScript can then parse and can try given code snippet for how to use jquery in xsl file


    < var title = '<xsl:value-of select="/data/player/title" />';

    markup: '
    <div class="controls">
    <div class="download"></div>
    <div class="play-pause">
    <p class="play"></p>

    <p class="error"></p>
    </div>
    </div>
    <div class="title"> ' +title+ ' </div>
    <div class="scrubber">
    <div class="progress"></div>
    <div class="loaded"></div>
    </div>


  • Sign In to post your comments