• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

i need ask about generating random sting after url, like url parameter

New Here ,
Jul 19, 2018 Jul 19, 2018

Copy link to clipboard

Copied

Hii,

anyone know how to generate random string or number , after url link? i was try like this :

var lower = 0; var upper = 100000000;

var url = "http://www.mypage.com/index.php?"+(Math.floor(Math.random()*(upper-lower))+lower)

windows.open("url");

but the button can't open my url.

thanks

TOPICS
Acrobat SDK and JavaScript , Windows

Views

388

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2018 Jul 19, 2018

Copy link to clipboard

Copied

Post the question only once.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 19, 2018 Jul 19, 2018

Copy link to clipboard

Copied

im sorry..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2018 Jul 19, 2018

Copy link to clipboard

Copied

What version of Adobe Acrobat do you use?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 19, 2018 Jul 19, 2018

Copy link to clipboard

Copied

adobe acrobat 18.011

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2018 Jul 19, 2018

Copy link to clipboard

Copied

Open the console with ctrl-j and look for error messages.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

ReferenceError: window is not defined

1:Link:Mouse Up

SyntaxError: syntax error

1:Console:Exec

undefined

SyntaxError: syntax error

1:Console:Exec

undefined

SyntaxError: syntax error

1:Console:Exec

undefined

SyntaxError: syntax error

4:

SyntaxError: syntax error

4:

SyntaxError: missing ; before statement

1:Console:Exec

undefined

SyntaxError: missing ; before statement

1:Console:Exec

undefined

ReferenceError: upper is not defined

1:Console:Exec

undefined

ReferenceError: upper is not defined

1:Console:Exec

undefined

ReferenceError: upper is not defined

1:Console:Exec

undefined

ReferenceError: upper is not defined

1:Link:Mouse Up

ReferenceError: upper is not defined

1:Link:Mouse Up

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

What is windows.open expected to do? I do not recognise this.

Also, I think you retyped your code. Please copy and paste the actual code (but change URL only)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

Try this:

var lower = 0; var upper = 100000000;

var url = "http://www.mypage.com/index.php?"+(Math.floor(Math.random()*(upper-lower))+lower);

app.launchURL(url);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

You should not name your variable "url", since there's a built-in property with that name and it might conflict. Use myURL, or something.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

The OP uses this name.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

I understand, but it should be changed none the less...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

it show errors like this:

ReferenceError: window is not defined

1:Link:Mouse Up

SyntaxError: syntax error

1:Console:Exec

undefined

SyntaxError: syntax error

1:Console:Exec

undefined

SyntaxError: syntax error

1:Console:Exec

undefined

SyntaxError: syntax error

4:

SyntaxError: syntax error

4:

SyntaxError: missing ; before statement

1:Console:Exec

undefined

SyntaxError: missing ; before statement

1:Console:Exec

undefined

ReferenceError: upper is not defined

1:Console:Exec

undefined

ReferenceError: upper is not defined

1:Console:Exec

undefined

ReferenceError: upper is not defined

1:Console:Exec

undefined

ReferenceError: upper is not defined

1:Link:Mouse Up

ReferenceError: upper is not defined

1:Link:Mouse Up

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

You need to select the entire code before running it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

it works, but must open adobe acrobat first, when im open in browser or in email attachment it not work

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

Sure, you need to use an Adobe product.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

do you have any soution?Test Screen Name​

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

Yes you need to use an Adobe product. Download and open in Reader.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

can i use window.open function?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2018 Jul 20, 2018

Copy link to clipboard

Copied

LATEST

Not from within the PDF file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines