I want to use the JsonObject value in a function which is defined in another function, so I am using it like below.
function downloadPDF(e) {
setImagesUploadedFile(objValue); // another function
var obj = objValue[0].Filename;
var filePath = SharedFilePath + obj;
$('#ImgSignedDoc').attr('href', filePath);}
And that function setImagesUploadedFile(objValue); is here like this
function setImagesUploadedFile(JsonObject) {
for (i = 0; i < JsonObject.length; i++) {
var obj = JsonObject[i].Filename;
var obj2 = "ImgSignedDoc";
var obj3 = JsonObject[i].FileType;
var datafileName = JsonObject[0].ImageName;
var ImgObj = parent.document.getElementById(obj2);
var Filename = datafileName.substring(datafileName.lastIndexOf('//') + 1);
ImgObj.innerText = Filename;
$(ImgObj).attr("data-filename", Filename);
}
}
and the error it shows is
0x800a1391 - JavaScript runtime error: 'objValue' is undefined
So what should I do or change in order to get the parameteres of setImagesUploadedFile(objValue) in my another function ??
setImagesUploadedFile(objValue);// objValue as argument but not defined. What you want exactly?JsonObjectin mydownloadPDFfunctionsetImagesUploadedFile()call?