Author Topic: javascript  (Read 17355 times)

0 Members and 1 Guest are viewing this topic.

Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« on: Thu, 02 September 2010, 11:05:24 »
I swear I'm not a software guy.  I studied basic when I was like 8, and I swore I would never touch programming again.  I've always wanted to be a super cool coder hacker programmer, but it just wasn't in the cards.  I've always been a hardware guy.  Every time I try to code it ends up in disaster.  I took a c++ class in college and ended up with a D.

 20 years later I'm trying my hand at javascript since it's integral to creating dynamic web pages that are actually considered web pages.  I'm not horrible at flash but given the recent turn of events where everyone hates flash I figured I'd be good to learn more traditional and accepted methods.

Anyway I'm having a horrible time.  My current assignment is simply to display a graphic and have it move across the screen from left to right utilizing css, to position it, then use a onload and timer functions.  I haven't got a clue.  The book is no help, and I don't really want to go begging the professor and let him know what an idiot I am as far as programming goes.  Everything I've tried has been disaster.

Anyway, any javascript gurus on this board that could maybe point me in the right direction?
« Last Edit: Thu, 02 September 2010, 11:09:51 by chimera15 »
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


javascript
« Reply #1 on: Thu, 02 September 2010, 11:46:59 »
I'm not sure what parts you're having difficulty with. Do you know how to position things using CSS? Do you have any kind of working knowledge of the JavaScript language?

I'm sorry to say that pretty much all JavaScript books suck. The only ones I'd recommend are: Flannagan (which is at least a good reference book on how to do browser programming, even if the description of the language itself is far from perfect), and possibly Crockford, which is all about the language itself, and is just about the only book that deals with the language correctly.

You need only the first book, but the second one might give you a much better understanding of the JavaScript language than anything else you will find in paper or online.

PS: If your course books and assignments aren't working for you, DO TELL THE INSTRUCTOR. You may not be the only one who's having problems. FWIW, going from "no programming and HTML knowledge" to "move stuff around on the page without using any kind of libraries" is not trivial.
« Last Edit: Thu, 02 September 2010, 11:49:46 by Superfluous Parentheses »
Current collection: HHKB Pro 2 black on black, HHKB Pro 2 white/grey blank, [strike]Dell AT101W[/strike] (sold to SirClickAlot), 1992 Model M, Key Tronic Ergoforce KT 2001, BTC 5100 C. Dead boards: MS Natural Elite, MS Natural 4000.

Offline instantkamera

  • Posts: 617
javascript
« Reply #2 on: Thu, 02 September 2010, 12:13:54 »
Quote from: Superfluous Parentheses;219177
I'm not sure what parts you're having difficulty with. Do you know how to position things using CSS? Do you have any kind of working knowledge of the JavaScript language?

I'm sorry to say that pretty much all JavaScript books suck. The only ones I'd recommend are: Flannagan (which is at least a good reference book on how to do browser programming, even if the description of the language itself is far from perfect), and possibly Crockford, which is all about the language itself, and is just about the only book that deals with the language correctly.

You need only the first book, but the second one might give you a much better understanding of the JavaScript language than anything else you will find in paper or online.

PS: If your course books and assignments aren't working for you, DO TELL THE INSTRUCTOR. You may not be the only one who's having problems. FWIW, going from "no programming and HTML knowledge" to "move stuff around on the page without using any kind of libraries" is not trivial.


agree 100%. Plus, speaking with the class instructor is at least as easy as asking a keyboard enthusiast group for help ...
Realforce 86UB - Razer Blackwidow - Dell AT101W - IBM model MCST  LtracX - Kensington Orbit - Logitech Trackman wheel opticalAMD PhenomII x6 - 16GB RAM - SSD - RAIDDell U2211H - Spyder3 - Eye One Display 2

Offline microsoft windows

  • Blue Troll of Death
  • * Exalted Elder
  • Posts: 3621
  • President of geekhack.org
    • Get Internet Explorer 6
javascript
« Reply #3 on: Thu, 02 September 2010, 12:22:15 »
I've got a JavaScript book from the late nineties if anybody needs it.
CLICK HERE!     OFFICIAL PRESIDENT OF GEEKHACK.ORG    MAKE AMERICA GREAT AGAIN MERRY CHRISTMAS

Offline Shawn Stanford

  • Posts: 368
javascript
« Reply #4 on: Thu, 02 September 2010, 13:04:04 »
I wrote a good amount of fairly complex JS a few years ago, but I haven't touched it in a while.

Every O'Reilly book I've used was excellent, and I have several - including an older version of the JavaScript book. There was another book that was really good, but I don't remember the title. I'll look for it when I get home. It had lots of nice, stealable code. Finally, I used the site 'WebMonkey.com' for a lot of hints and tips.
The Brat Prince of COBOL

Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« Reply #5 on: Thu, 02 September 2010, 13:06:32 »
I found this website:

http://www.webreference.com/programming/javascript/java_anim/2.html

And also this tutorial:

http://www.c-point.com/javascript_tutorial/MMTutorial/lMoveImage.htm


Which is very close to the assignment.

But the problem is the css.  I get how the css assigns a name to the picture in that code, but it doesn't look like css I've ever seen before, and as far as I know doesn't use div's so I couldn't assign it to a stylesheet.

The code there is this:

 style=" left: 0px; position: absolute; top: 50px"
   height=auto;
     width=auto;
      align=baseline;
    src="ani_cat.gif">

I tried to change it to something more like this:





 


This worked to display the image, but it broke the animation.
I don't get why.
« Last Edit: Thu, 02 September 2010, 13:10:22 by chimera15 »
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


javascript
« Reply #6 on: Thu, 02 September 2010, 13:32:19 »
Quote from: chimera15;219216
But the problem is the css.  I get how the css assigns a name to the picture in that code, but it doesn't look like css I've ever seen before, and as far as I know doesn't use div's so I couldn't assign it to a stylesheet.

The code there is this:

 style=" left: 0px; position: absolute; top: 50px"
   height=auto;
     width=auto;
      align=baseline;
    src="ani_cat.gif">

I tried to change it to something more like this:





 


This worked to display the image, but it broke the animation.
I don't get why.
Stylesheets/CSS can only assign values to the style of an element. You can't set things like ID or CLASS attributes using CSS. Where it gets confusing is that, for mostly historical reasons, some elements have attributes that are pretty much equivalent to styles (IMG has width and height attributes, for example, but with and height are also style attributes).

Some other observations:

You don't need a DIV to style any element, CSS can style pretty much anything (the exception being form widgets which are usually restricted from styling in some ways). If you have an IMG or DIV or P or H3 or whatever with an ID attribute, you can style it using the CSS:

TEXT



#id-of-element {
  style-attribute: value;
  another-style-attribute: value2;
}

If you want to style a group of elements, you generally want to target the CLASS attribute (IDs must be unique, classes are designed to be used on multiple elements):

TEXT


TEXT

.class-of-element {
  border: 1px solid black; /* for example */
}

The idea behind IDs and CLASSes is to let scripts and style sheets target the HTML elements. There would be no point to setting IDs and CLASSes using CSS even if you could.

If you want to style all elements of some type (IMG, H3, whatever) you can do that too:

h3 {
  border: 2px solid red;
  background-color: blue;
}

Note the # and . preceding ids and classes in the CSS.

Last note: in CSS you NEVER use an = sign. Style attributes are assigned using name: value (not name= value). You should also pay close attention to the exact position of quote marks and other delimiters, or it'll just not work.

I recommend you use firefox with the firebug extension installed and enabled. Also, switching on Firefox's error console should give you decent feedback about any javascript, css and html errors you might be making.

PS: if you want to animate anything, the "position: absolute" style attribute is essential, so leave it in the stylesheet or the HTML. Throw out the "float: $whatever". Position and Float are conflicting attributes. Read up on those attributes if you're interested later.
« Last Edit: Thu, 02 September 2010, 13:42:13 by Superfluous Parentheses »
Current collection: HHKB Pro 2 black on black, HHKB Pro 2 white/grey blank, [strike]Dell AT101W[/strike] (sold to SirClickAlot), 1992 Model M, Key Tronic Ergoforce KT 2001, BTC 5100 C. Dead boards: MS Natural Elite, MS Natural 4000.

Offline instantkamera

  • Posts: 617
javascript
« Reply #7 on: Thu, 02 September 2010, 13:45:19 »
Quote from: chimera15;219216
I found this website:

it doesn't look like css I've ever seen before

The code there is this:

style= left: 0px; position: absolute; top: 50px"
   height=auto;
     width=auto;
      align=baseline;
    src="ani_cat.gif">


The part in bold is inline css, the rest are just regular html attributes that happen to also be controllable via css.



I tried to change it to something more like this:

[QUOTE="chimera15;219216]



 


This worked to display the image, but it broke the animation.
I don't get why.[/QUOTE]
the line in bold is an issue. you copied the html "style" attribute, it is un-necessary here as stand-alone CSS is ALL ABOUT style (as the name implies). Also, as SP mentioned, you cant assign the ID using CSS.
Realforce 86UB - Razer Blackwidow - Dell AT101W - IBM model MCST  LtracX - Kensington Orbit - Logitech Trackman wheel opticalAMD PhenomII x6 - 16GB RAM - SSD - RAIDDell U2211H - Spyder3 - Eye One Display 2

Offline instantkamera

  • Posts: 617
javascript
« Reply #8 on: Thu, 02 September 2010, 14:35:47 »
Quote from: Shawn Stanford;219214
I wrote a good amount of fairly complex JS a few years ago, but I haven't touched it in a while.

Every O'Reilly book I've used was excellent, and I have several - including an older version of the JavaScript book. There was another book that was really good, but I don't remember the title. I'll look for it when I get home. It had lots of nice, stealable code. Finally, I used the site 'WebMonkey.com' for a lot of hints and tips.


that reminds me of:



there's a really funny one of them stacked up so you can really see the difference in thickness, but I couldn't find it ... hilar.
Realforce 86UB - Razer Blackwidow - Dell AT101W - IBM model MCST  LtracX - Kensington Orbit - Logitech Trackman wheel opticalAMD PhenomII x6 - 16GB RAM - SSD - RAIDDell U2211H - Spyder3 - Eye One Display 2

javascript
« Reply #9 on: Thu, 02 September 2010, 14:55:15 »
Quote from: instantkamera;219256
there's a really funny one of them stacked up so you can really see the difference in thickness, but I couldn't find it ... hilar.


:D I actually recommended both up thread.

But note that "JavaScript the definitive guide" is actually much more about browser stuff than JavaScript. JavaScript is fairly simple. Browsers are complex. The problem is that most JavaScript books just skip over the JavaScript part and go straight to the browser stuff, which explains a lot of the really awful JS code you find everywhere. "JavaScript, the good parts" is really a reaction to that, and IMHO required reading for anyone "doing" JavaScript professionally - especially if they haven't used a dozen other languages.
Current collection: HHKB Pro 2 black on black, HHKB Pro 2 white/grey blank, [strike]Dell AT101W[/strike] (sold to SirClickAlot), 1992 Model M, Key Tronic Ergoforce KT 2001, BTC 5100 C. Dead boards: MS Natural Elite, MS Natural 4000.

Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« Reply #10 on: Thu, 02 September 2010, 17:29:01 »
Quote from: instantkamera;219228
The part in bold is inline css, the rest are just regular html attributes that happen to also be controllable via css.



I tried to change it to something more like this:


the line in bold is an issue. you copied the html "style" attribute, it is un-necessary here as stand-alone CSS is ALL ABOUT style (as the name implies). Also, as SP mentioned, you cant assign the ID using CSS.

Oh alright, so only style=" left: 0px; position: absolute; top: 50px"  is the css in this? The rest is html?? hmm...

It's been a year since I learned css, and forgotten most of it, but it doesn't look like normal css I'm used to seeing at all.

You have to assign the name of the image in html, so you can use the javascript function on it?

Alright I think I see it a little better now, it's more like:

style=" left: 0px;
          position: absolute;
           top: 50px"
height=auto;
width=auto;
align=baseline;
src="ani_cat.gif">

Why isn't there a ; after the img id though....  Oh well it didn't indent like I wanted it to.
« Last Edit: Thu, 02 September 2010, 17:37:32 by chimera15 »
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


javascript
« Reply #11 on: Thu, 02 September 2010, 17:34:19 »
Quote from: chimera15;219315
Oh alright, so only style=" left: 0px; position: absolute; top: 50px"  is the css in this? The rest is html?? hmm...
Yeah. the style="bla bla bla" stuff in the HTML is just a way to provide "inline" styles, and has the same syntax as CSS.

Quote
It's been a year since I learned css, and forgotten most of it, but it doesn't look like normal css I'm used to seeing at all.
Looks normal to me :)
Quote
You have to assign the name of the image in html, so you can use the javascript function on it?
It's easiest to assign an id or a class. Names are IIRC only valid for form widgets and links, not "normal" HTML elements, and in any case, names are harder to address. You can use other more advanced constructs, but in this case, I'd go for a plain ID, since you're only interested in moving and styling one specific item, and addressing things by id is the easiest and most portable method of accessing/modifying stuff in JavaScript (via the getElementById() method).
« Last Edit: Thu, 02 September 2010, 17:37:43 by Superfluous Parentheses »
Current collection: HHKB Pro 2 black on black, HHKB Pro 2 white/grey blank, [strike]Dell AT101W[/strike] (sold to SirClickAlot), 1992 Model M, Key Tronic Ergoforce KT 2001, BTC 5100 C. Dead boards: MS Natural Elite, MS Natural 4000.

Offline pfink

  • Posts: 196
javascript
« Reply #12 on: Thu, 02 September 2010, 18:48:30 »

Offline microsoft windows

  • Blue Troll of Death
  • * Exalted Elder
  • Posts: 3621
  • President of geekhack.org
    • Get Internet Explorer 6
javascript
« Reply #13 on: Thu, 02 September 2010, 19:38:29 »
I was looking through my software and found the perfect JavaScript program for EIBM--It's from the 90's and it's IBM branded!

And mine's still new in the plastic wrap!
CLICK HERE!     OFFICIAL PRESIDENT OF GEEKHACK.ORG    MAKE AMERICA GREAT AGAIN MERRY CHRISTMAS

Offline Shawn Stanford

  • Posts: 368
javascript
« Reply #14 on: Thu, 02 September 2010, 20:05:34 »
This:
The Brat Prince of COBOL

Offline microsoft windows

  • Blue Troll of Death
  • * Exalted Elder
  • Posts: 3621
  • President of geekhack.org
    • Get Internet Explorer 6
javascript
« Reply #15 on: Thu, 02 September 2010, 20:15:40 »
Ooh! Is it compatible with Windows 98?
CLICK HERE!     OFFICIAL PRESIDENT OF GEEKHACK.ORG    MAKE AMERICA GREAT AGAIN MERRY CHRISTMAS

javascript
« Reply #16 on: Thu, 02 September 2010, 20:19:14 »
Quote from: microsoft windows;219368
Ooh! Is it compatible with Windows 98?


Color scheme certainly indicates '95 or '98.
Current collection: HHKB Pro 2 black on black, HHKB Pro 2 white/grey blank, [strike]Dell AT101W[/strike] (sold to SirClickAlot), 1992 Model M, Key Tronic Ergoforce KT 2001, BTC 5100 C. Dead boards: MS Natural Elite, MS Natural 4000.

Offline pfink

  • Posts: 196
javascript
« Reply #17 on: Thu, 02 September 2010, 20:22:44 »
Quote from: microsoft windows;219357
I was looking through my software and found the perfect JavaScript program for EIBM--It's from the 90's and it's IBM branded!
Show Image

And mine's still new in the plastic wrap!


Java != JavaScript

Offline EverythingIBM

  • Posts: 1269
javascript
« Reply #18 on: Fri, 03 September 2010, 02:28:57 »
Quote from: microsoft windows;219357
I was looking through my software and found the perfect JavaScript program for EIBM--It's from the 90's and it's IBM branded!
Show Image

And mine's still new in the plastic wrap!


I find it amazing at how much old software you have brand new still shrinkwrapped.

If you don't have any use for it, I'd consider getting that off of you in the future... it would be funny to show my friend who's studying Java script.
Keyboards: '86 M, M5-2, M13, SSK, F AT, F XT

Offline instantkamera

  • Posts: 617
javascript
« Reply #19 on: Fri, 03 September 2010, 06:09:03 »
Quote from: microsoft windows;219357
I was looking through my software and found the perfect JavaScript program for EIBM--It's from the 90's and it's IBM branded!
Show Image

And mine's still new in the plastic wrap!



uggggh. :doh:


Quote from: pfink;219371
Java != JavaScript


YES, THANK YOU!
Realforce 86UB - Razer Blackwidow - Dell AT101W - IBM model MCST  LtracX - Kensington Orbit - Logitech Trackman wheel opticalAMD PhenomII x6 - 16GB RAM - SSD - RAIDDell U2211H - Spyder3 - Eye One Display 2

Offline Findecanor

  • Posts: 5036
  • Location: Koriko
javascript
« Reply #20 on: Fri, 03 September 2010, 06:55:18 »
* Inline CSS is ugly: don't use it, except for testing how things work.
* JSON is simple, effective and very dirty: Use XML.
* Business logic and security concerns should be handled on the server, not in Javascript in the browser. Don't send more stuff in objects between client and server than what is absolutely necessary.
* Learn how objects work in Javascript. Javascript is a "prototype-based" object-oriented language, and thinking in classes does not always work.

Offline EverythingIBM

  • Posts: 1269
javascript
« Reply #21 on: Fri, 03 September 2010, 07:10:32 »
Quote from: instantkamera;219477
uggggh. :doh:
YES, THANK YOU!


You don't have to get your diaper in a tangle over a simple mistake:
Keyboards: '86 M, M5-2, M13, SSK, F AT, F XT

Offline Konrad

  • Posts: 348
javascript
« Reply #22 on: Fri, 03 September 2010, 07:11:36 »
Quote from: chimera15
... I'm not horrible at flash but given the recent turn of events where everyone hates flash I figured I'd be good to learn more traditional and accepted methods.
Flash haters?
 
Flash is good. Flash makes things blink and zing and animate and adds interest and sheer excitement to each and every web visit. Some flash gimmicks are entertaining or original enough to make me pause and waste time just hovering across menu bars (making me briefly forget the content I was supposed to find). Maybe that's perfectly normal, or maybe I have mental problems (caused by years of studying things like Java, ahem).
 
But there is a darkside to flash. Like those bloaty video placeholders which take up half a screen slowly loading some needlessly hi-res video that won't do anything more than a static menu and some product photos could do better. Forcing the visitor to view lengthy presentations (probably about something else he isn't actually looking for, like google ads on youtube) is just not good. Animations which take a little time to play out without allowing the user to speed through to the content he wants are bad. Page layouts which play animations across dozens of tiny animated hover zones are very annoying when the visitor is trying to scroll through lists or click on something he sees at the faraway side of the screen. Anything which denies the visitor full use (and full speed) of his mouse/cursor control is simply begging for trouble. Any flash which forces the user to patiently wait in front of the door (even for a couple seconds) will cause many people to simply walk away and take their browsing elsewhere. And I'm talking broadband here ... how those poor 56K bastards survive on the internet is beyond me, but it can't hurt to help them limp along with lightweight pages that use flash in a sparing and smart manner. As in all things, small code runs faster. And the more potential security alarms your site triggers (ranging from harmless cookies to expired certificates to linking into external or ActiveX flash players), the more people with paranoid browser settings will be wary of remaining. The internet is a virtual land of limitless opportunity, people won't stay anywhere that annoys them because it takes only a moment to find another destination. It's all about speed; flash animation delays can be avoided, flash downloading times can be minimized. Don't be stupid and force visitors to automatically listen to songs or watch videos when they might be searching for something else. Usually something else very specific, because they found the link to your page on a search engine.
 
Avoid being seduced by the perils of the darkside and flash will be your ally. Once down the path of bloaty flash you begin, forever will it consume your site's destiny.
« Last Edit: Fri, 03 September 2010, 07:38:37 by Konrad »

Offline instantkamera

  • Posts: 617
javascript
« Reply #23 on: Fri, 03 September 2010, 07:28:39 »
Quote from: EverythingIBM;219487
You don't have to get your diaper in a tangle over a simple mistake:
Show Image



That diaper is clearly not tangled.
Realforce 86UB - Razer Blackwidow - Dell AT101W - IBM model MCST  LtracX - Kensington Orbit - Logitech Trackman wheel opticalAMD PhenomII x6 - 16GB RAM - SSD - RAIDDell U2211H - Spyder3 - Eye One Display 2

Offline Konrad

  • Posts: 348
javascript
« Reply #24 on: Fri, 03 September 2010, 07:42:07 »
That's a really pathetic looking sumo wrestler.

Offline Findecanor

  • Posts: 5036
  • Location: Koriko
javascript
« Reply #25 on: Fri, 03 September 2010, 09:21:22 »
I don't like flash. The web based based on open standards and should remain so, but Flash is a proprietary, closed format, controlled by Adobe. Too many web sites depend on Adobe's good will and ability not to introduce bugs in the next update that may disable features that the site depend on.

However, the biggest gripe I have, as a user, is that the browser's "Back" button does not work in Flash. Too many times, I have navigated deeply into a site which has felt like any other HTML-based site and clicked "Back", only to find myself somewhere else completely.

Offline itlnstln

  • Posts: 7048
javascript
« Reply #26 on: Fri, 03 September 2010, 09:23:41 »
Quote from: EverythingIBM;219487
You don't have to get your diaper in a tangle over a simple mistake:
Show Image


Yo, dawg, you might not want to share personal photos.


Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« Reply #27 on: Fri, 03 September 2010, 09:55:44 »
Quote from: pfink;219335
Here ya go:

http://www.soybomb.com/ratpfink/javascript/


Oh wow that's amazing!!! Wow thanks so much.  That uses a css and style that looks much more familiar.  I'll have to ask you some questions about this when I try to redo it later today.
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« Reply #28 on: Fri, 03 September 2010, 09:57:15 »
Quote from: microsoft windows;219357
I was looking through my software and found the perfect JavaScript program for EIBM--It's from the 90's and it's IBM branded!
Show Image

And mine's still new in the plastic wrap!

That's Java not Javascript. They named them alike to confuse people, but they're two different things, although they look alike as well cause they're both based on C. lol

Edit:
Already stated I guess.   I just learned this myself in this class. I always thought they were the same as well.  I always wondered why somethings required me to install a runtime environment, while others worked perfectly on a machine in a browser with nothing installed at all. lol  I guess now I know.
« Last Edit: Fri, 03 September 2010, 10:06:01 by chimera15 »
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« Reply #29 on: Fri, 03 September 2010, 10:01:12 »
Quote from: Konrad;219488
Flash haters?
 
Flash is good. Flash makes things blink and zing and animate and adds interest and sheer excitement to each and every web visit. Some flash gimmicks are entertaining or original enough to make me pause and waste time just hovering across menu bars (making me briefly forget the content I was supposed to find). Maybe that's perfectly normal, or maybe I have mental problems (caused by years of studying things like Java, ahem).
 
But there is a darkside to flash. Like those bloaty video placeholders which take up half a screen slowly loading some needlessly hi-res video that won't do anything more than a static menu and some product photos could do better. Forcing the visitor to view lengthy presentations (probably about something else he isn't actually looking for, like google ads on youtube) is just not good. Animations which take a little time to play out without allowing the user to speed through to the content he wants are bad. Page layouts which play animations across dozens of tiny animated hover zones are very annoying when the visitor is trying to scroll through lists or click on something he sees at the faraway side of the screen. Anything which denies the visitor full use (and full speed) of his mouse/cursor control is simply begging for trouble. Any flash which forces the user to patiently wait in front of the door (even for a couple seconds) will cause many people to simply walk away and take their browsing elsewhere. And I'm talking broadband here ... how those poor 56K bastards survive on the internet is beyond me, but it can't hurt to help them limp along with lightweight pages that use flash in a sparing and smart manner. As in all things, small code runs faster. And the more potential security alarms your site triggers (ranging from harmless cookies to expired certificates to linking into external or ActiveX flash players), the more people with paranoid browser settings will be wary of remaining. The internet is a virtual land of limitless opportunity, people won't stay anywhere that annoys them because it takes only a moment to find another destination. It's all about speed; flash animation delays can be avoided, flash downloading times can be minimized. Don't be stupid and force visitors to automatically listen to songs or watch videos when they might be searching for something else. Usually something else very specific, because they found the link to your page on a search engine.
 
Avoid being seduced by the perils of the darkside and flash will be your ally. Once down the path of bloaty flash you begin, forever will it consume your site's destiny.


I know, but there are a ton of flash haters.  I love flash. Unfortunately this has spread to even Apple, and I can't access my current website that I built with a flash menu on their devices.  So I'm going to try rework it with javascript.  That assuming that I can understand even an iota of it.
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline pfink

  • Posts: 196
javascript
« Reply #30 on: Fri, 03 September 2010, 10:09:58 »
Quote from: chimera15;219537
Oh wow that's amazing!!! Wow thanks so much.  That uses a css and style that looks much more familiar.  I'll have to ask you some questions about this when I try to redo it later today.


No problem. It's basically just doing an infinite recursion and moving the object 1 pixel to the right every 20 milliseconds.

As an exercise you can try modifying it so that it wraps back around or stops when it hits the right side of the screen.

Offline instantkamera

  • Posts: 617
javascript
« Reply #31 on: Fri, 03 September 2010, 10:13:12 »
flash sucks for reasons already stated.

so much about that vid seems wrong.
Realforce 86UB - Razer Blackwidow - Dell AT101W - IBM model MCST  LtracX - Kensington Orbit - Logitech Trackman wheel opticalAMD PhenomII x6 - 16GB RAM - SSD - RAIDDell U2211H - Spyder3 - Eye One Display 2

Offline itlnstln

  • Posts: 7048
javascript
« Reply #32 on: Fri, 03 September 2010, 10:59:38 »
While I agree with all the "closed platform" stuff, I think Flash makes it easier for people to share content, especially less technical people.  I think the Web is more about content sharing than being an open platform (save that for Linux).  Anything that helps people share content > platform type, IMO.  Ideally, there would be tools that are easy to use that support open platforms.


Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« Reply #33 on: Fri, 03 September 2010, 18:15:03 »
Quote from: ripster;219543
A life without Flash is a dull life indeed.


My flash is flashier.

Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline ricercar

  • * Elevated Elder
  • Posts: 1697
  • Location: Silicon Valley
  • mostly abides
javascript
« Reply #34 on: Fri, 03 September 2010, 23:14:23 »
I'll second the Brat Prince. This is my Javascript reference.



Peachpit "visual quickstart" books rock.
I trolled Geekhack and all I got was an eponymous SPOS.

Offline Konrad

  • Posts: 348
javascript
« Reply #35 on: Sat, 04 September 2010, 00:39:25 »
Another +1 for the O'Reilly books, though I'll admit I never read any others so I can't really compare.
 
Once you know "enough" you just graduate to the interweb.  Not just the sites which show java code you can steal, but also to sites that use nice java code you can steal.

Offline EverythingIBM

  • Posts: 1269
javascript
« Reply #36 on: Sat, 04 September 2010, 20:32:44 »
Quote from: itlnstln;219526
Yo, dawg, you might not want to share personal photos.


So this is how you treat your GF?


And here's a luigi-lego-head.


Uh oh, Ripster is going to get some serious envy.

« Last Edit: Sat, 04 September 2010, 20:38:11 by EverythingIBM »
Keyboards: '86 M, M5-2, M13, SSK, F AT, F XT

Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« Reply #37 on: Sat, 04 September 2010, 21:52:22 »
Alright thanks. I'll look that book up.  I think I managed to solve the problem I was having thanks to Pfink and some other examples I found thanks to some classmates.
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« Reply #38 on: Wed, 08 September 2010, 21:09:24 »
Next problem.  We're doing forms.  I have a form that gets passed to email, simply.  It doesn't use a form engine, it just opens an email agent on the user's computer.  The task is to put the day's current date in the body of the email automatically.  I can figure out how to get the date in javascript, but not how to pass that variable to the body of the email.  If I put the javascript in the body of a text field or something, obviously the scripting won't work, and just the scripting won't pass the value by being there.

I looked all over the web and found people with similar problems, but no solutions.  Can't find anything in the book.
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline pfink

  • Posts: 196
javascript
« Reply #39 on: Sat, 11 September 2010, 15:21:53 »
Quote from: chimera15;221107
Next problem.  We're doing forms.  I have a form that gets passed to email, simply.  It doesn't use a form engine, it just opens an email agent on the user's computer.  The task is to put the day's current date in the body of the email automatically.  I can figure out how to get the date in javascript, but not how to pass that variable to the body of the email.  If I put the javascript in the body of a text field or something, obviously the scripting won't work, and just the scripting won't pass the value by being there.

I looked all over the web and found people with similar problems, but no solutions.  Can't find anything in the book.


Something like this?

http://www.soybomb.com/ratpfink/javascript/SendEmail.htm

Offline keyb_gr

  • Posts: 1384
  • Location: Germany
  • Cherrified user
    • My keyboard page (German)
javascript
« Reply #40 on: Sat, 11 September 2010, 16:42:04 »
That should be one of these "mailto: link with extra arguments" things. AFAIK this is not standardized but enjoys fairly wide support nonetheless.

Coming back to the first problem, unfortunately I'm not aware of any other CSS intro that would be as nicely structured and "bottom-up" as Michael Jendryschik's German-language one. Understanding how CSS "ticks" is important, including the various kinds of selectors and the box model. Unsurprisingly, browser support for more advanced stuff still is a mess (if a lot more useful than it was years ago), but we've got lists for that.
Hardware in signatures clutters Google search results. There should be a field in the profile for that (again).

This message was probably typed on a vintage G80-3000 with blues. Double-shots, baby. :D

Offline JBert

  • Posts: 764
javascript
« Reply #41 on: Sun, 12 September 2010, 07:34:21 »
Quote from: keyb_gr;222104
That should be one of these "mailto: link with extra arguments" things. AFAIK this is not standardized but enjoys fairly wide support nonetheless.
Waaah? There is an RFC for that, namely RFC2368 - The mailto URL scheme. I would recommend reading it, it might be dry material but it is after all the reference.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« Reply #42 on: Fri, 17 September 2010, 01:18:06 »
Sorry I solved that one.  I forgot to write back that I solved it.  Thanks for the help though.  I need to solve these by Sunday though, cause that's the due date..so no good answering after that.


Next problem I think I really need help.

We're basically supposed to build a simulation of an oscilloscope, with 3 variables that will define the speed.  We're supposed to create a diamond, that will have amplitude, speed, and oscillation per second data.... and apparently draw a line.  Really up the creek on this one.

I mean where did this come from? It's crazy I think.  Sometimes I think this course is there just to fail me. lol
« Last Edit: Fri, 17 September 2010, 01:21:59 by chimera15 »
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline timw4mail

  • Posts: 1329
    • https://timshomepage.net
javascript
« Reply #43 on: Fri, 17 September 2010, 07:41:47 »
Quote from: chimera15;219541
I know, but there are a ton of flash haters.  I love flash. Unfortunately this has spread to even Apple, and I can't access my current website that I built with a flash menu on their devices.  So I'm going to try rework it with javascript.  That assuming that I can understand even an iota of it.

It's people like you who give flash a bad name. Never use flash for essential things like navigation!
Buckling Springs IBM Model F AT, New Model F 77, Unicomp New Model M
Clicky iOne Scorpius M10, OCN-branded Ducky DK-9008-C, Blackmore Nocturna, Redragon Kumara K552-1, Qtronix Scorpius Keypad, Chicony KB-5181(Monterey)
Tactile Apple AEKII (Cream damped ALPS), Filco FKBN91M/JB (Japanese Tenkeyless), Cherry G84-5200, Cherry G84-4100LPAUS, Datalux Spacesaver(Cherry ML), Redragon Devarajas K556 RGB, Newmen GM711, Poker II (Cherry MX Clear), Logitech G910 Orion Spark, Logitech K840
Linear Lenovo Y (Gateron Red), Aluminum kiosk keyboard (Cherry MX Black)

Offline keyboardlover

  • Posts: 4022
  • Hey Paul Walker, Click It or Ticket!
    • http://www.keyboardlover.com
javascript
« Reply #44 on: Fri, 17 September 2010, 07:45:30 »
Quote from: timw4mail;224129
It's people like you who give flash a bad name. Never use flash for essential things like navigation!


Ugh...just use PHP!!

Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« Reply #45 on: Fri, 17 September 2010, 08:24:38 »
Quote from: timw4mail;224129
It's people like you who give flash a bad name. Never use flash for essential things like navigation!

I already had this argument on this board.  It's one of the reasons decided to change it.
It's a shame, it's a beautiful flash menu that interfaces great with html.  Made absolutely beautifully in actionscript.  The point of me using it was that allowed me to use flashy animation on the permanent parts of my website and still use html/css for updateable/easily changed parts.


It's no different from any website that uses flash as a main app, only you can actually see html on my page as well.  I could have just put in backup html as another solution, or something but it would have added clutter.  So my goal is to create a javascript menu, then a javascript function that detects if they have flash installed and will switch between the two menus.


My goal is to create really interactive and mind blowing websites, and that's really impossible as a single person at least without using flash.  Even javascript it would take me months to write anything that comes close to something I can polish off in flash in less than a week, and never be anywhere near as cool looking.

Besides as this javascript class is apparently proving, I don't really have the math/programming skills to code some amazing website using javascript.
 

 I don't really want to get in another flame war about this.
« Last Edit: Fri, 17 September 2010, 08:53:50 by chimera15 »
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« Reply #46 on: Fri, 17 September 2010, 08:32:24 »
Quote from: keyboardlover;224130
Ugh...just use PHP!!

php and javascript don't really have the same dynamic look and potential as the flash menu I was using.

I'm actually looking at some javascript libraries and some of them can make some pretty nice looking menus though.  I've never used a javascript library though so not exactly sure what it will entail, but I have to say my eyes have been opened a little toward using more compatible means.

Currently I'm really stuck on this assignment though, and I need to get it done cause I have to get to classwork in my other classes.

I decided it's not really asking you to draw an oscilloscope, but to merely move a css object across the screen in the path of a sine wave, since javascript doesn't really have a native way to draw something like that. So similar to that other one I was having trouble with.    I hope that's what it means at least. I'm having a horrible time just doing that as well.  Some of these assignments are really cryptic.  
« Last Edit: Fri, 17 September 2010, 08:47:06 by chimera15 »
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline timw4mail

  • Posts: 1329
    • https://timshomepage.net
javascript
« Reply #47 on: Fri, 17 September 2010, 08:56:42 »
Quote from: chimera15;224135
php and javascript don't really have the same dynamic look and potential as the flash menu I was using.

I'm actually looking at some javascript libraries and some of them can make some pretty nice looking menus though.  I've never used a javascript library though so not exactly sure what it will entail, but I have to say my eyes have been opened a little toward using more compatible means.

Currently I'm really stuck on this assignment though, and I need to get it done cause I have to get to classwork in my other classes.

I decided it's not really asking you to draw an oscilloscope, but to merely move a css object across the screen in the path of a sine wave, since javascript doesn't really have a native way to draw something like that. So similar to that other one I was having trouble with.    I hope that's what it means at least. I'm having a horrible time just doing that as well.  Some of these assignments are really cryptic.  

My site uses CSS-only dropdown menus. To be honest, such "dynamic" menus that require flash are more of an annoyance than they are cool. As a user, I don't care about your fancy menu, I just want to be able to use the website. (Not that I haven't been guilty of similar things myself (Although not regarding flash)).
Buckling Springs IBM Model F AT, New Model F 77, Unicomp New Model M
Clicky iOne Scorpius M10, OCN-branded Ducky DK-9008-C, Blackmore Nocturna, Redragon Kumara K552-1, Qtronix Scorpius Keypad, Chicony KB-5181(Monterey)
Tactile Apple AEKII (Cream damped ALPS), Filco FKBN91M/JB (Japanese Tenkeyless), Cherry G84-5200, Cherry G84-4100LPAUS, Datalux Spacesaver(Cherry ML), Redragon Devarajas K556 RGB, Newmen GM711, Poker II (Cherry MX Clear), Logitech G910 Orion Spark, Logitech K840
Linear Lenovo Y (Gateron Red), Aluminum kiosk keyboard (Cherry MX Black)

Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« Reply #48 on: Fri, 17 September 2010, 09:03:17 »
Quote from: timw4mail;224139
My site uses CSS-only dropdown menus. To be honest, such "dynamic" menus that require flash are more of an annoyance than they are cool. As a user, I don't care about your fancy menu, I just want to be able to use the website. (Not that I haven't been guilty of similar things myself (Although not regarding flash)).

Since the site is question is a portfolio site, I really want to show what I can do. The website itself is the point of using the website at all basically, it's not like it's a search engine, or government site that has content that is the primary point and function is the ultimate goal.  It's supposed to show all the bells and whistles I'm capable of producing, not to mention double as a design portfolio since that's one of the jobs I potentially want to get as well.

The first site I built uses a javascript/css menu(or really about the 5th incarnation of it), but it's pretty lax and I've had people tell me it looks unprofessional, even though it's pretty business like, and more straight forward as you've described.

 So that's what I'm going for with this new site, a professional looking high quality design.

I also think you can use flash and have nice design and still be as intuitive to the user, if not more than a traditionally built site.  That's what good design is all about really, being functional and yet still having pleasing form.

Some flash sites are what really inspired me to try to get back into web design and get a degree to try and pursue it professionally.  Now that flash is on the out and I've gotten all this negative feedback about trying to do stuff in flash, it's pretty sad.  I don't know.
« Last Edit: Fri, 17 September 2010, 09:13:24 by chimera15 »
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline chimera15

  • Thread Starter
  • Posts: 1441
javascript
« Reply #49 on: Fri, 17 September 2010, 09:29:42 »
I found this code and adapted it somewhat.  It translates an image in the x and y direction, but it's really complex and unlike anything I've seen.  It also had functions to do other things like make the image transparent which I've somewhat trimmed off.  It's like way beyond me and I can't follow the flow of the functions.  It's the only code I've gotten to work though that has math.sin functions in it.  The rest all use external libraries or code I also can't figure out.

So how do I make the thing just follow a sin wave with 3 standard variables?  I need to prun it down big time.

    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


 








Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx