File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes New article: Baby Steps With Scriptaculous Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "New article: Baby Steps With Scriptaculous" Watch "New article: Baby Steps With Scriptaculous" New topic
Author

New article: Baby Steps With Scriptaculous

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42360
    
  64
The November issue of the JavaRanch Journal has an article by David O'Meara about Baby Steps With Scriptaculous. You can check it out here, and if you have comments or question, feel free to post them in this thread.


Ping & DNS - my free Android networking tools app
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61449
    
  67

Splendid article!


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61449
    
  67

Originally posted by Frank Lawlor:
I tried the first example.

In IE it just fails with "Error: 'Effect' is undefined.

In Firefox something works, but the screen displayed is:



-- Frank
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61449
    
  67

Did you place the .js files in the correct location? All of them?

Even though prototype.js and scriptaculous.js are the only script files explicitly referenced in the HTML file, all of the Scriptaculous script files must be present as scriptaculous.js is just a dynamic loader for the other files.
[ November 08, 2007: Message edited by: Bear Bibeault ]
Frank Lawlor
Greenhorn

Joined: Aug 21, 2006
Posts: 7
I copied all the .js files into a javascript subdirectory and I still get the same results. Since it seems to somewhat work under Firefox, I assume the directory structure is correct and it is finding the files.

Originally I only copied some of the files since the article explicitly said "we just need the ones listed."

I copied the files to another system and got the same results.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61449
    
  67

Originally posted by Frank Lawlor:
I copied all the .js files into a javascript subdirectory and I still get the same results.

How are you referencing the js files from the HTML page? If I recall, the article assumes that they are in the same folder as the HTML file?

Since it seems to somewhat work under Firefox, I assume the directory structure is correct and it is finding the files.

Not necessarily the best of assumptions. Firefox is really bad about silently swallowing undefined reference errors.
[ November 09, 2007: Message edited by: Bear Bibeault ]
Frank Lawlor
Greenhorn

Joined: Aug 21, 2006
Posts: 7
I copied the code exactly as in the example (cut and paste).

Firfox might swallow errors, but, as I said, it basically works so it must be finding the js files (or it wouldn't work at all).

I notice that if I click on the example imbedded in the article, I get the same results (IE doesn't work at all) but it is better formatted as buttons.
Frank Lawlor
Greenhorn

Joined: Aug 21, 2006
Posts: 7
If I move the test1.html file to anoter location is doesn't work at all, even under FireFox.

The example has the files in a javascript subdir.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61449
    
  67

Originally posted by Frank Lawlor:
I notice that if I click on the example imbedded in the article, I get the same results (IE doesn't work at all) but it is better formatted as buttons.

The little "blind up" and "blind down" examples in the article don't work for you?

That means that the issue is not with your setup but rather with the browsers themselves. What could be wrong that would cause this to fail across browsers is beyond me. The in-article examples are working fine for me on Firefox and Safari. They work on Opera as well, but the animation is a bit stilted.

Do you have the opportunity to hit the article with another machine and try the in-article examples?
[ November 09, 2007: Message edited by: Bear Bibeault ]
Frank Lawlor
Greenhorn

Joined: Aug 21, 2006
Posts: 7
I tried the exmple in the article on another machine.
Same results as on my machine.
Works in Firefox, fails in IE.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61449
    
  67

Hmmm, I have no way to test in IE until Tuesday. Will check into it then.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I looked into the problem and it is because the script tags have

type="application/x-javascript"

it needs to be

type="text/javascript"

Eric
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42360
    
  64
Originally posted by Eric Pascarello:
it needs to be

type="text/javascript"


Fixed.
Frank Lawlor
Greenhorn

Joined: Aug 21, 2006
Posts: 7
Yup, that did the trick. Now it functions on IE, too. Thanks.

The styling, however, looks nothing like the article and I don't see anything to make them look like buttons. The explicit 200px style is causing the first title to break to a second line on my machines.

It really is a good idea to have someone else try out your examples before you submit an article. So many mistakes in your first example can destroy your credibility and make people disinclined to read on.
 
wood burning stoves
 
subject: New article: Baby Steps With Scriptaculous