Javascript question function call from another .js file

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: Tracker Support, TrackerSupp-Daniel, Paul - Tracker Supp, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Tracker Supp-Stefan, Ivan - Tracker Software

Post Reply
User avatar
yogi108
User
Posts: 70
Joined: Thu Mar 09, 2017 9:13 am
Location: Austria, Theiß
Contact:

Javascript question function call from another .js file

Post by yogi108 » Mon May 20, 2019 9:18 am

Hi,

I have some Javascript files, which are working well.
Creating buttons in the tool register of the PDF-XChange Editor,
after clicking the buttons the action desired runs like a charm.

Now I came across the following:
I press one button and at the end of the script I have a yes/no dialog.
If yes it should call a function from another Javascript file, not inside the same file.

The separate file with only one function in it works if called through the button I created.
The file name and the function name are
filename "dblpagenumbers.js"
function "function dblpagenumbers()"
No parameters to pass.

if I call in the script the function from the other script
dblpagenumbers();
I get the error at the last line of the script:
Mozilla JavaScript Engine is initialized (vJavaScript-C 17.0.4esrpre)
App:Init:204: TypeError: this.flattenPages is not a function
but all other actions are also not working in this separate script.

So again the scripts are working well if called separately from the menubuttons.

Is there any hint/syntax to call a function from the same directory
from another script?
As I understand the scripts are loaded all from this PDF-XChange Javascript directory at starting of PDF-XChange.

Simple thing long explained, hope you understand,

regards,
Fritz
"You cannot know the meaning of your life until you are connected to the power that created you.”
Shri Mataji Nirmala Devi, founder of Sahaja Yoga

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13296
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Javascript question function call from another .js file

Post by Tracker Supp-Stefan » Mon May 20, 2019 11:15 am

Hello Fritz,

I've asked a colleague from the dev team for some help with your enquiry and we will post further guidance shortly!

Regards,
Stefan

User avatar
yogi108
User
Posts: 70
Joined: Thu Mar 09, 2017 9:13 am
Location: Austria, Theiß
Contact:

Re: Javascript question function call from another .js file

Post by yogi108 » Mon May 20, 2019 11:42 am

Thanks in advance,

regards
Fritz
"You cannot know the meaning of your life until you are connected to the power that created you.”
Shri Mataji Nirmala Devi, founder of Sahaja Yoga

User avatar
TrackerSupp-Daniel
Site Admin
Posts: 2164
Joined: Wed Jan 03, 2018 6:52 pm

Re: Javascript question function call from another .js file

Post by TrackerSupp-Daniel » Wed May 22, 2019 8:24 pm

:)
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD

Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

Post Reply