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

New Here ,
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

148

Likes

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

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

New Here ,
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

149

Likes

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
Jul 19, 2018 0
Adobe Community Professional ,
Jul 19, 2018

Copy link to clipboard

Copied

Post the question only once.

Likes

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
Reply
Loading...
Jul 19, 2018 0
New Here ,
Jul 19, 2018

Copy link to clipboard

Copied

im sorry..

Likes

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
Reply
Loading...
Jul 19, 2018 0
Adobe Community Professional ,
Jul 19, 2018

Copy link to clipboard

Copied

What version of Adobe Acrobat do you use?

Likes

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
Reply
Loading...
Jul 19, 2018 0
New Here ,
Jul 19, 2018

Copy link to clipboard

Copied

adobe acrobat 18.011

Likes

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
Reply
Loading...
Jul 19, 2018 0
Adobe Community Professional ,
Jul 19, 2018

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jul 19, 2018 0
New Here ,
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

Likes

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
Reply
Loading...
Jul 20, 2018 0
Most Valuable Participant ,
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)

Likes

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
Reply
Loading...
Jul 20, 2018 0
Adobe Community Professional ,
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);

Likes

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
Reply
Loading...
Jul 20, 2018 1
Most Valuable Participant ,
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.

Likes

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
Reply
Loading...
Jul 20, 2018 0
Adobe Community Professional ,
Jul 20, 2018

Copy link to clipboard

Copied

The OP uses this name.

Likes

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
Reply
Loading...
Jul 20, 2018 0
Most Valuable Participant ,
Jul 20, 2018

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jul 20, 2018 0
New Here ,
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

Likes

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
Reply
Loading...
Jul 20, 2018 0
Most Valuable Participant ,
Jul 20, 2018

Copy link to clipboard

Copied

You need to select the entire code before running it.

Likes

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
Reply
Loading...
Jul 20, 2018 0
New Here ,
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

Likes

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
Reply
Loading...
Jul 20, 2018 0