Question

I have a program in which calling a script function in dblclick of a tr.Also Passing some arguments which is generated dynamically

Part of my markup is

<tr id="#ID#_#VERSION_ID#" ondblclick="ShowAssetPreviewPopup(#PreviewPath#, #UUID#, #GENERAL_VIRTUAL_PATH#)"

The preview path will be replaced by something like this 'http://example.somethingsomething.mp4' and in the same way other 2 parameteres too. Up to here every thing is ok and as I click that tr the following function will get evoked

function ShowAssetPreviewPopup(PreviewPath, UUID, LowresVirtualpath) {   
            $("#divPreviewPopUp").find("#divVideoPreview").html("example");
            $("#divPreviewPopUp").css({"display:block"});
            $("#divPreviewPopUp").css({ "top": (($(window).height() / 2) - ($("#divPreviewPopUp").height() / 2)) });
            $("#divPreviewPopUp").css({ "left": (($(window).width() / 2) - ($("#divPreviewPopUp").width() / 2)) });
}

But an error is occurring in Firebug

enter image description here

What would be the reason and how to solve this?

Was it helpful?

Solution 2

I assume #PreviewPath# is a string variable from your template engine. You have to surround these string variables by single quotes.

<tr id="#ID#_#VERSION_ID#" ondblclick="ShowAssetPreviewPopup('#PreviewPath#', #UUID#, '#GENERAL_VIRTUAL_PATH#')">

OTHER TIPS

Try to change:

$("#divPreviewPopUp").css("display:block");

to:

$("#divPreviewPopUp").css("display", "block");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top