Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Apr 2006
    Location
    USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer Help a Student Graduate!!

    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.

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

    Myluckystar13
    Last edited by myluckystar13; 04-08-2006 at 11:41 AM.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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/dynamici...roamcursor.htm
    And finally you should read this about homework.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Apr 2006
    Location
    USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!
    Last edited by myluckystar13; 04-08-2006 at 11:53 AM.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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
    Code:
    setTimeout("somefunction()",thevariablethatholds60-totalsecondstimes1000)
    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/
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    here is a nice site to get u started,
    http://www.htmlgoodies.com/beyond/javascript/

  • #6
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    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.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •