Javascript - "launchurl" with dynamic creation

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

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

User avatar
Peter2
User
Posts: 958
Joined: Mon Sep 13, 2010 10:09 am

Javascript - "launchurl" with dynamic creation

Post by Peter2 »

I can use app.launchurl exactly as described in reference:

Code: Select all

app.launchURL("http://www.example.com/", true);
works fine.

But I want to use it with "dynamic created content", e.g. I have a form where I can select the strings "help / products / shop", and as result I create the address like this:

Code: Select all

var newaddress = "http://www.example.com/" + this.getfield("my_list")
Result is

Code: Select all

newaddress = "http://www.example.com/products"
Now I want to call this URL, but I get

Code: Select all

Console:Exec:18: TypeError: app.launchurl is not a function
What can I do?
PDF-X-Change Pro German
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Javascript - "launchurl" with dynamic creation

Post by Stefan - PDF-XChange »

Hello Peter2,

Function names are case sensitive.

app.launchurl is not the same as app.launchURL and you will get the error if you try to use the first!

Kind regards,
Stefan
User avatar
Peter2
User
Posts: 958
Joined: Mon Sep 13, 2010 10:09 am

Re: Javascript - "launchurl" with dynamic creation

Post by Peter2 »

Tracker Supp-Stefan wrote: Fri Oct 21, 2022 12:42 pm ...Function names are case sensitive....
:oops: :oops: :oops: :oops:

My 5% mixture of some languages has some pitfalls ..

Thanks, Stefan, enjoy your weekend.
PDF-X-Change Pro German
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Javascript - "launchurl" with dynamic creation

Post by Stefan - PDF-XChange »

:)