Hello!
What i'm trying to do is to add a javascript after caption which turns on http://vkontakte.ru/developers.php?o=-1&p=Comments comments system for every single image when when we click on it.
Having spent many hours on this forum i came to a conclusion that i should use hs.Expander.prototype.onAfterGetCaption script in my header.php to have a desired result (in Wordpress)
these were my steps:
1) added required scripts before </head>
2) added another script in header:
<script type="text/javascript">
hs.Expander.prototype.onAfterGetCaption = function (sender) {
if (sender.caption) {
sender.caption.innerHTML += '<h3>Leave a Comment:</h3>' +
'<div id="vk_comments"></div>' +
VK.Widgets.Comments("vk_comments", {limit: 20, width: "496"});
}
}
</script>
3) didn't get the result (
I had some luck after turning on a ready pre-made vkcomments plugin - http://wordpress.org/extend/plugins/vkcomments/ for adding comments to posts with all steps above. But unfortunately it doesn't work correctly
Please! maybe something wrong in hs.Expander.prototype.onAfterGetCaption. Or maybe there are any other variants??