Modal popup script not loading

Modal popup script not loading

  

HI all ,

I am having list of images that are comes form database. I want to show in modal popup which can be daggable on the click of the image for that i have used jBox external javascript and css and binded it in to one webblock. after that i've added this web block before the image list And added expression widget to hold the javascript in that my script is as follows. but it shows error as src variable null at red colored line. Is there any solution for it??

Note : for jBox i have refered demo of link https://jsfiddle.net/StephanWagner/boLchs3h/  

SyntaxEditor Code Snippet

"<script>

$(document).ready(function(){
var modalImg = document.getElementById('"+myImg.Id+"');
 new jBox('Modal', {
    attach: $('#"+myImg.Id+"'),
    width: 220,
    title: 'Attachment image',
    overlay: false,
    createOnInit: false,/* Getting error here either it set true or false*/
    content: '<img src='+modalImg.src+'>',
    draggable: true,
    repositionOnOpen: true,
    repositionOnContent: false
  });*/
});

Hi Kiran,

It's impossible to say what you've done wrong without knowing the way you integrated the JavaScript into your code. However, afaik it's impossible to get an error on a single line of an object initialization, so I'm tempted to think there's something else going on.