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

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

New Here ,
Jul 19, 2018 Jul 19, 2018

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
602
Translate
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

Post the question only once.

Translate
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

im sorry..

Translate
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

What version of Adobe Acrobat do you use?

Translate
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

adobe acrobat 18.011

Translate
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

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

Translate
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

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

Translate
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

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)

Translate
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

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);

Translate
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

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.

Translate
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

The OP uses this name.

Translate
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

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

Translate
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

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

Translate
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

You need to select the entire code before running it.

Translate
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

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

Translate
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

Sure, you need to use an Adobe product.

Translate
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

do you have any soution?Test Screen Name​

Translate
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

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

Translate
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

can i use window.open function?

Translate
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
LATEST

Not from within the PDF file.

Translate
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