This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Can someone help me with this assignement? (Function) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Can someone help me with this assignement? (Function) " Watch "Can someone help me with this assignement? (Function) " New topic
Author

Can someone help me with this assignement? (Function)

Mimi Sini
Greenhorn

Joined: Oct 16, 2008
Posts: 18
I've read my lecture over and over, I can't seem to figure this one out.

Complete the following script that generates two random numbers for variables m and n in the range of 0 to 10 and displays the result of m/n.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

What specifically are you having problems with?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mimi Sini
Greenhorn

Joined: Oct 16, 2008
Posts: 18
I have no idea how to display m divided by n, I thought it was document.write(m/n) or using for, but I'm not getting it.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

Ah! document.write() is only useful for inline script when the page is being initially displayed. It's not generally useful for events after the page load so it's not used very much.

If you want to display something as part of the HTML page, there are a number of ways to do it. The easier is a property on elements named innerHTML. Search around a bit for that term and you should be able to find some examples of its use.
Mimi Sini
Greenhorn

Joined: Oct 16, 2008
Posts: 18
My instructions are that I can only add code to the body of the function, and not add, remove or change anything after the brace
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

Shouldn't be an issue.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can someone help me with this assignement? (Function)