First
I guess the table is being built upon json source or JavaScript array, in other words it's being injected dynamically, so in such cases you should never use $(selector).event(handler);
but instead $(document).on(event, selector, handler);
So your code will be:
$(document).on('dblclick', "#VIDEO_GRID > tbody > tr", function (e) {
// event handler here
});
For more information see this precious post.
Second
I would highly recommend you avoid using document
as a variable name, even your code is working (I doubt it) it will be so confusing to use such name as a reference.
Third
To load a remote page into a td
you have nothing to do with draw
function, but instead you can make ajax request to the appropriate page and then inject it into the td
by .html
function.
So by putting all points together you will end with something like this:
$(document).on('dblclick', "#VIDEO_GRID > tbody > tr", function (e) {
var me = this;
request = $.ajax({
url: 'videoInfo.html'
});
// closure used to avoid conflict see the post below for more information
request.done((function(){
var _that = me;
return function(response){ _that.find('td:first').html(response); console.log('page loaded !');}
})());
request.fail(function(){
console.log('page not loaded :(');
});
console.log("double clicked");
});
post mentioned in the comment.