Hi all,
I have the following velocity code in xwiki page, I can see the fid and
fname values when I retrieve entryobj from the server side, so I want to
use javascript to add the fid and fname to image link node as parameters of
the href url. the problem is the javascript loaded event function never got
called, why?
Thanks very much.
Dave
{{velocity filter="none"}}
{{html clean="false" wiki="true"}}
<script type="text/javascript">
//<![CDATA[
document.observe("xwiki:dom:loaded", function(){
var imageNode = document.getElementById('tmViewImages');
var url = imageNode.href;
var index = url.indexOf("?");
if(index!=-1)
url = url.substring(0,index-1);
url=url+"?FID=$!fid&FName=$!fname";
imageNode.href=url;
//]]>
</script>
#getEntryItemObject($doc $entryObj)
#if("$!entryObj" == '')
#warning($msg.get('xe.blog.sheet.notpost'))
## Keep testing the inline action for backward compatibility with older
blog posts.
#elseif($xcontext.action != 'edit' && $xcontext.action !=
'inline')
## View mode
#set($fid=$entryObj.getProperty('FID').value)
#set($fname=$entryObj.getProperty('FName').value)
fid view: $fid
fname view: $fname