View Full Version : Help a Student Graduate!!

04-08-2006, 10:50 AM
I am in my senior year at school and I took a Javascripting course thinking that it would be simple to learn and not too difficult. My major is NOT Computer Science or Programming but Management. I know Vis Basic and C++ as well as OLD languages like Fortran. Needless to say, I am having difficulty with the changes in programming that have occurred in the last 3 years. My C and Vis Basic classes were 3 years ago. I need to write some simple programs and I am lost. ANY help in the right direction would be appreciated. I have Dreamweaver to help or I can straight code in Front Page. How do I do the following?

A. Create page that displays a quote that changes every minute, with the minute, as it is changing on the time display of your pc.

B. Read in Data from an XML File into a form?

C. Make a picture run from the cursor - now I know that this is onmousemove, but I am lost as to how to make sure it never catches it.:confused:

I would appreciate any hints in the right direction... Please help a non-programmer make it through a difficult course :o .

Myluckystar13 :thumbsup:

04-08-2006, 10:55 AM
And you've tried what exactly? We aren't here to just give you code. You should be helping yourself graduate by paying attention in class. Few questions you need to ask yourself. Where is the quote coming from? Will these be predefined? You can put them in an array and increase the index every minute using setTimeout.
I don't really work with XML but I sure a little searching could help you there. And the last one this may help you http://www.dynamicdrive.com/dynamicindex13/roamcursor.htm
And finally you should read this about homework (http://www.codingforums.com/showthread.php?t=53446).

04-08-2006, 12:33 PM
Answers to your post:

I did go to class...I wasn't asking you to do my homework. I just wanted a little direction if you could help. AND YOU DID. Thanx.

Yes, the quotes are predefined by me. I have already written the code for them in an array, I was just worried about how to access the seconds of time. I thought I had to set the seconds part of time to a variable and every time it changed to 00, to writeln the particular array element.

Thanks for your comments. I certainly didn't mean for someone to write the code for me. The problem is that in classes now, there are too many students and too little time. They really don't show you any actual coding. Only examples in the book that are very impractical and simplistic. There is never enough time to get to the more complex part of coding with the questions of 300 students, the language barrier there is with my teacher, and the focus on getting through the book rather than actual "learning". I would have thought people would be more sympathetic to someone trying to learn.

I guess the concern is that I wasn't trying to do so....but I certainly am.

Note the change to the original post about the timed one. It has to be with the minute change on the pc display of time.

At any rate, thanks for your help! :)

04-08-2006, 01:17 PM
A. Create a new date object. Get the seconds and assign it to a variable. Now set another variable equal to 60 - thevariablethatholdsseconds multiple this by 1000. Then you can use

This function will increase a counter variable that starts at 0. You can make it display the array, by using innerHTML or DOM. I'm not going to write the function for you. You will need to figure it out. You will need an if statement that checks to see if the value of the variablethatholds60minustotalseconds is 0. If it is 0 then you can use setInterval("somefunction()",60000);
Basically the time seconds will get recorded on page load. Then you subtract 60 - the seconds to get the total seconds till the next minute. At this time 60 - 60 will be 0 and then you can use the setInterval to call the function that changes the quotes on the page every 60 seconds. 1 second is equal to 1000 milliseconds.
This site should help you with B. http://www.w3schools.com/xml/

04-11-2006, 01:02 PM
here is a nice site to get u started,

04-11-2006, 01:55 PM
Ok now, here's the basis of Javascript (it might look rather different from other languages, as javascript is a client-side dynamic language)

A web page has elements (tags and text). Elements migh have particular attributes(properties). Attributes have values.

Javascript was designed to create and change dinamically elements, attributes and values. In order to do that, javascript uses methods and objects both to refere and to modify the elements, attributes and values. The relationship is made my assigments and statemets

All these methods, objects, assigments and statements are usually nested inside functions. Functions are called by events, following the user's actions.

I hope these very basic notes will clarify the way javascript works.

For me, I would have liked to have had known these basics when I had started learning javascript, as I did it alone, with no teacher around. :)