Nick Harms

Ranch Hand
+ Follow
since Mar 06, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Nick Harms

Hopefully all that information helps. There is not a specific image with that name as you asked before, the function selects the image depending on the time. I am pretty sure thats how it works.
it screwed up my code again

Bear Bibeault wrote:OK, that looks a little better.

Is there really an image file with the resulting name in the same folder as the HTML file?

By the way, using a tool like Firebug in Firefox will let you look at the active HTML DOM so you can see what the result of your statement actually becomes in the DOM.

Chrome also has such tools.



well the mapNum variable is referencing the getMap() function,
My book says The getMap() function which returns a number from 0 to 23. The number matches the number of the sky map image to show based on the current date and time. That function has been placed in an external javascript file named datetime.js which you can see I accessed in the top of the code.
The timeStr also refers to a function in that file and it actually works. In the project folder there are 0-23 images and I guess the function reads the time and displays the apropriate picture.

My task was this
4. Scroll down the file to the div element with the id value maps and replace the line
(which is now gone) with a script element that writes the following html code.

where mapNum is the value of the mapNum variable

Bear Bibeault wrote:When posting HTML be sure to click the 'disable HTML' checkbox.

First, you need to fix your syntax. Your quoting is wrong.

Second, if the image tag doesn't have a src attribute to identify its image file, of course nothing will appear.



Well here is what I have now
If the quoting is still wrong that's what I need help on, and what that last part posted isn't what I wanted to post anyways, it did have a src
Can you help me from this further? It is still not showing an image.

Bear Bibeault wrote:You haven't done a particularly god job of letting us know what problem you are having.



# <script type="text/javascript">
# document.write('<img id="sky" ' />');
# </script>

That's what I have so far, I don't know how to explain it any better, I copied the question out of the book, did my best to try it for myself and the image is not displaying.
I need help to figure out what is wrong with my script and why it is not doing what the book wants it to do.
I just wish someone could help me.......
Ok , the problem is

Scroll down to the div element with id value maps and replace the line
<img id="sky" src="sky0.jpg" alt="" />
with a script element that writes the following html code:
<img id='sky' src='mapNum.jpg' alt=' ' />
were mapNum is the value of the mapNum Variable.

I've been redoing this several times and can't seem to get everywhere,
I had to do a similar thing with the clock but got it to work right away.

Any help is greatly appreciated!

Never mind I got it, should be RetailItem one= new RetailItem();
15 years ago
Ok now its saying cannot find symbol - class item in the demo. on the item one = new RetailItem(); line. Why is that? It matches the class name.
15 years ago
This public Retailitem() is giving me this error, not sure why, to the naked eye it looks just like my example, probably a simple fixed.
Says invalid method declaration return type required,
This is a class a demo uses.



15 years ago
Well I know you could say double rad were it reads the input but how would you initialize it to 0 there?
Figured I might as well ask while Im here.

15 years ago



YAY!
Thanks again, you are my hero. I knew it was something stupid!
Another AH HA! moment thanks to java ranch.
15 years ago
I thought that was what the object did? Do i simply need to move the object to after I ask them instead of before.
15 years ago
There ya go!
I know this is probably a dumb question but i want to be sure that I dont need to change anything in the class after switching these right?

15 years ago
Well, the demo demonstrates the class by using its methods, It will first ask the user for their radius and then send that to the class to be used in the methods to find the information. the methods return the desired information which you call by calling the object reference and the method name, such as circle.getDiameter.
15 years ago