Javascript error in documentLoad trigger

Hi,

The following code gives me javascript error and I can't see why.

function showPDFViewer() {
pdfviewer = new ej.pdfviewer.PdfViewer({
serviceUrl: 'https://xxxxx.com:6001/api/pdfviewer',
documentPath: fileContent,
documentLoad: "documentLoaded"
});

pdfviewer.appendTo('#pdfviewer');
});
}

function documentLoaded(args) {
//code...
}


This is the javascript error in the Chrome console when the document loads:


What I am doing wrong?

Thank you very much!


6 Replies 1 reply marked as answer

PA Pere Argelich Romà September 22, 2022 06:03 PM UTC

This is a example:

https://stackblitz.com/edit/vxjdjb-bhesgf?file=index.js

The "It works!" alert is never displayed.

Thank you 



AC ArunKumar Chandrakesan Syncfusion Team September 23, 2022 01:35 PM UTC

Hi Pere,

Kindly refer to the modified sample to get the alert message during loading and let us know if the solution provided  is helpful to you.

Stack blitz: https://stackblitz.com/edit/vxjdjb-vzn6rm?file=index.js


Regards,

Arun kumar


Marked as answer

PA Pere Argelich Romà replied to ArunKumar Chandrakesan September 23, 2022 02:21 PM UTC

Now it works fine!

Thank you very much!



AC ArunKumar Chandrakesan Syncfusion Team September 26, 2022 06:18 AM UTC

Hi Pere,

Thank you for your updates. You can close the ticket if you have no further queries here.

Regards,

Arun kumar



PA Pere Argelich Romà replied to ArunKumar Chandrakesan September 26, 2022 07:21 AM UTC

Hi ArunKumar,

How do I close the ticket? (I have already marked an answer as a solution)

Regards,



AA Anitha Azhagesan Syncfusion Team September 26, 2022 08:43 AM UTC

Hi Pere,

We have marked this forum as solved.

Regards,

Anitha


Loader.
Up arrow icon