[Javascript] need help with JScript!!

WolfSong wolfsong at midcoast.com
Thu Apr 26 16:14:57 CDT 2001


May 8 is the day of the presentation...I have to have it up on the web by the end of next week at the latest (Prof. has to read it before I can do the presentation -- his idea of a term paper.)  Why?  Been working on it for 2 1/2 weeks now!!!  :-) Thought I'd start looking for help from live people instead of books.

Audra
  ----- Original Message ----- 
  From: Karau, Joe 
  To: 'javascript at LaTech.edu' 
  Sent: Thursday, April 26, 2001 4:18 PM
  Subject: RE: [Javascript] need help with JScript!!


  When is this presentation due?

  Joseph Karau 
  Kingland Systems 
  joe.karau at kingland.com 
  507-536-3629 
  AIM: jkara3629 

    -----Original Message-----
    From: WolfSong [mailto:wolfsong at midcoast.com]
    Sent: Thursday, April 26, 2001 2:57 PM
    To: javascript at LaTech.edu
    Subject: [Javascript] need help with JScript!!


    Hello all,

    Yes, I'm a newbie.  I'm working on a presentation for my computer science class at the University of Maine at Augusta.  My presentation is taking apart a java/j script that works in both Netscape and IE and creating 2 separate scripts (ie, one Javascript and one jscript).  I took the program apart and created the Javascript without problem.  My problem is the jscript.  I cannot get it to work and have absolutely no idea what I'm doing wrong.  Can anyone help?  (NOTE: I've already downloaded the documentation at microsoft for jscript.)

    Thanks,
    Audra

    Here is the jscript code and the html that goes with it.

    var speed = 2; // smaller number moves the snow faster
    var dx, xp, yp;    // coordinate and position variables
    var am, stx, sty;  // amplitude and step variables
    var i =0;
    doc_width = document.body.clientWidth;
    doc_height = document.body.clientHeight;

    dx = new Array();
    xp = new Array();
    yp = new Array();
    am = new Array();
    stx = new Array();
    sty = new Array();

    for (i = 0; i < 10; ++ i) {  
    dx[i] = 2;                        // set coordinate variables
    xp[i] = Math.random()*(doc_width-50);  // set position variables
    yp[i] = Math.random()*doc_height;
    am[i] = Math.random()*20;         // set amplitude variables
    stx[i] = 0.02 + Math.random()/10; // set step variables
    sty[i] = 0.7 + Math.random();
    }
    function ufoIE() {  // IE main animation function
    for (i = 0; i < 10; ++ i) {  // iterate for every dot
    yp[i] += sty[i];
    if (yp[i] > doc_height-50) {
    xp[i] = Math.random()*(doc_width-am[i]-30);
    yp[i] = 0;
    stx[i] = 0.02 + Math.random()/10;
    sty[i] = 0.7 + Math.random();

    }
    dx[i] += stx[i];
    document.all[i].style.pixelTop = yp[i];
    document.all[i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
    }
    setTimeout("ufoIE()", speed);
    }
    ufoIE();

    -------------------------------------------------------------
    Here is the html code that I wrote for the jscript:

    <HTML>
    <HEAD>
    <TITLE>Internet Explorer - Animation - JScript
    </TITLE>

    </HEAD>
    <BODY OnLoad="window.defaultStatus='JScript in Action!!';" bgcolor="#000000">


    <div id="a" style = POSITION: absolute; Z-INDEX: i; VISIBILITY: visible; TOP: 15px; LEFT: 15px;><img src="ufo2.gif" border="0"></div>

    <script src="ufoIE.asp"></script>

    </body>
    </html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010426/b21a0219/attachment.htm>


More information about the Javascript mailing list