HighDots Forums  

Syntax error con Companion JS

Javascript (Italian) Il linguaggio JavaScript (it.comp.lang.javascript)


Discuss Syntax error con Companion JS in the Javascript (Italian) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Cristiano Larghi
 
Posts: n/a

Default Re: Syntax error con Companion JS - 10-08-2009 , 06:48 AM






Il Thu, 08 Oct 2009 12:49:00 +0200, frank ha scritto:

Quote:
Companion JS
che è?

Quote:
mi dice che a questa riga c'è un errore di sintassi:
var num_rand = Math.floor( Math.random() * 72 );
Non riesco a capire dove è l'errore; la sintassi sembra corretta.
anche a me.

Reply With Quote
  #2  
Old   
frank
 
Posts: n/a

Default Syntax error con Companion JS - 10-08-2009 , 06:49 AM






Companion JS mi dice che a questa riga c'è un errore di sintassi:

var num_rand = Math.floor( Math.random() * 72 );

Non riesco a capire dove è l'errore; la sintassi sembra corretta.

Grazie

Reply With Quote
  #3  
Old   
Cristiano Larghi
 
Posts: n/a

Default Re: Syntax error con Companion JS - 10-08-2009 , 06:52 AM



Il Thu, 08 Oct 2009 10:48:04 +0000, Cristiano Larghi ha scritto:

Quote:
mi dice che a questa riga c'è un errore di sintassi: var num_rand =
Math.floor( Math.random() * 72 ); Non riesco a capire dove è l'errore;
la sintassi sembra corretta.

anche a me.
basta che come url in firefox metti javascript:alert(Math.floor
( Math.random() * 72 )) e vedrai che funziona correttamente ...

Reply With Quote
  #4  
Old   
frank
 
Posts: n/a

Default Re: Syntax error con Companion JS - 10-08-2009 , 07:24 AM



Cristiano Larghi ha scritto:

Quote:
basta che come url in firefox metti javascript:alert(Math.floor
( Math.random() * 72 )) e vedrai che funziona correttamente ...
Funziona anche con IE7...il problema è come memorizzare in una variabile
questo numero random generato?

Grazie

Reply With Quote
  #5  
Old   
Cristiano Larghi
 
Posts: n/a

Default Re: Syntax error con Companion JS - 10-08-2009 , 07:49 AM



Il Thu, 08 Oct 2009 13:24:01 +0200, frank ha scritto:

Quote:
Funziona anche con IE7...il problema è come memorizzare in una variabile
questo numero random generato?
come hai fatto te... sempre da url:
javascript:var num_rand=Math.floor( Math.random() * 72 );alert(num_rand);

Reply With Quote
  #6  
Old   
Dr J R Stockton
 
Posts: n/a

Default Re: Syntax error con Companion JS - 10-09-2009 , 02:13 PM



In it.comp.lang.javascript messaggio <4acdcbdb$0$1095$4fafbaef (AT) reader3 (DOT) n
ews.tin.it>, 8 Oct 2009 13:24:01, frank <frank (AT) 127 (DOT) 0.0.1> ha scritto:
Quote:
Cristiano Larghi ha scritto:

basta che come url in firefox metti javascript:alert(Math.floor
( Math.random() * 72 )) e vedrai che funziona correttamente ...

Funziona anche con IE7...il problema è come memorizzare in una
variabile questo numero random generato?
Il codice sembra buono.
The code seems good.
<http://jibbering.com/faq/index.html#randomNumber> (Inglese)
<URL:http://www.merlyn.demon.co.uk/js-randm.htm> (Inglese)


--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk IE7 FF3 Op9 Sf3
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.