I have a JavaScript call inside the content like below
<a onclick="playVideo('http://xx/002A70/ChampionsOfChange/xx.mp4','Victor Dickson',tcm:24-17703); return false;" href="#">
<img style="width: 200px; height: 113px;" alt="VictorDickson" title="VictorDickson" xlink:href="tcm:24-17552" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="VictorDickson" />
</a>
In the playVideo
call, the third parameter is file path. I have a text file (closed caption file) in Tridion as Multimedia component and I need to pass that file path to the javascript.
If I hard code the file path as below, it's working
<a onclick="playVideo('http:/xx.mp4','Victor Dickson','/TridionMultimedia/tcm24-17703_Champions-of-change-George-Shout-Out.txt'); return false;" href="#">
<img style="width: 200px; height: 113px;" alt="VictorDickson" title="VictorDickson" xlink:href="tcm:24-17552" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="VictorDickson" />
</a>
But I am looking to pass the tcm id. Any suggestions?
EDIT
Thanks everyone for the comments. I did the following to fix the issue
In the XML i added file as component link and in the XSLT i added a tag to grab the xhref and passing that id in the javascript call
XML
<CaptionLink xlink:type="simple" xlink:href="tcm:24-17703" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="Champions-of-change-George-Shout-Out" />
<a onclick="playVideo('http://wpc.2A70.edgecastcdn.net/002A70/ChampionsOfChange/Victor-Employers-say-theyre-very-flexible.mp4','Victor Dickson',$('#George_cc').attr('href')); return false;" href="#">
<img style="width: 200px; height: 113px;" alt="VictorDickson" title="VictorDickson" xlink:href="tcm:24-17552" xlink:title="VictorDickson" xmlns:xlink="http://www.w3.org/1999/xlink" />
</a>
XSLT
<a id="George_cc" href="#">
<xsl:attribute name="href">
<xsl:value-of select="//Component:CaptionLink/@xlink:href" />
</xsl:attribute>
</a>