Eric Brannan

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromEric Brannan
ToMe
SubjectProblem running Falling Snow Script
Date21 December 2006 09:46
Mark,

I am trying to use your falling snow effect on a small business homepage,
but cannot get it to work.  My knowledge of web design is fairly basic and
knowledge of Java programming even less, so still at the fumbling stage, but
keen to learn and experiment.  I (believe I) have followed your guidelines,
but see no snow...  It appears that your code does not actually draw the
snowflake images - is that correct?  Do I need to draw / obtain my own
images then link them to "snowflake.gif", or should the script work without
further additions?

I am using Win XP and trying to use the effect on the homepage of [URL].  I
have tried it on Firefox, Opera, NS Navigator and IE.  Are there any obvious
mistakes I am making? 

Thanks for your time.

Eric
FromMe
ToEric Brannan
SubjectRe: Problem running Falling Snow Script
Date21 December 2006 19:16
Eric,

> I am trying to use your falling snow effect on a small business
> homepage, but cannot get it to work

1. put the script before the </body> tag (note the / in it)

2. your src="foo" is pointing to my local disk (and does not use a valid URL
anyway - local disk URLs start with file://). The script is not on my local
disk. It should be on your Web site. The src="foo" attribute behaves exactly
like the src="foo" attribute for images.

> knowledge of Java

Note: it's JavaScript, not Java - they are completely different, totally
unrelated languages :)


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromEric Brannan
ToMe
SubjectRe: Problem running Falling Snow Script
Date21 December 2006 21:57
Tarquin.

Thanks for your reply and education on diff between Java and JavaScript.

I've played around with it for another couple of hours, but still no success
- I guess it's still a bit beyond my embryonic knowledge and experience! 
I'll try some other ideas a bit later.

The script is on my Web site and was on my local site when I tested the
first attempts - perhaps I am not pointing to the file correctly.  Not sure
I fully understand how the script and image files should be linked.

Do I need to use my own snowflake image, or is the image contained within
your code file - I can't see it?  Ive tried both using my own image file and
using only your script.

Eric
FromMe
ToEric Brannan
SubjectRe: Problem running Falling Snow Script
Date21 December 2006 22:53
Eric,

> Do I need to use my own snowflake image

You need an image, or you can grab a copy of mine:
http://www.howtocreate.co.uk/tutorials/jsexamples/snowflake.gif

But even if you fail to get the image right, you should still see
_something_, since it falls back to using an alt text of '*' if the image
does not load.

Next, you got the name of the script wrong, it is snowscript, not snowcsript
- that does not matter, of course, it should work no matter what you call it
:)

Lastly, and this is the important one, you removed my comments from the
script source, which is a violation of my license terms - please read them
and abide by them if you plan to use the script:
http://www.howtocreate.co.uk/jslibs/termsOfUse.html

When you removed them, you made a mistake, and broke the script. Try it in
Opera and see the error console - it gives a nice error message that shows
what the mistake is. Please download a new copy of the script, and keep my
comments intact this time:
http://www.howtocreate.co.uk/jslibs/snowscript.js
FromEric Brannan
ToMe
SubjectRe: Problem running Falling Snow Script
Date21 December 2006 23:35
Tarquin,

Thanks again, I'll try as you suggest.  Sorry about removal of your comments
- totally unintentional - I've tried so many different things that I must
have changed the original script without noticing.  I wasn't sure which
parts needed replacing with my own files and which had to remain unaltered. 
I'll start again from scratch and ensure the original is reinstated.  Also
must srot my dislexia.  I'll let you know if and when I get it working -
hopefully before next xmas......

Eric
FromEric Brannan
ToMe
SubjectRe: Problem running Falling Snow Script
Date22 December 2006 00:38
Tarquin,

Thanks for your help - all working as advertised now - brilliant!

BTW, the link you gave for your example snowflake seems to lead to a blank
page - perhaps a white snowflake on a white background.  How do I find it?

Still had to delete some bits to get it to work without error messages - I
think all your comments are still intact.  If I have inadvertantly deleted
anyting you would rather I have included, please let me know and I will
amend it as you wish.


All the best,
Eric
FromMe
ToEric Brannan
SubjectRe: Problem running Falling Snow Script
Date22 December 2006 12:01
Eric,

> BTW, the link you gave for your example snowflake seems to lead to a blank
> page - perhaps a white snowflake on a white background.  How do I find it?

It is a white image, and your browser chooses to use a white background when
displaying it :)

Once you have opened it, use your browser's 'file' menu to save it.

> Still had to delete some bits to get it to work without error messages - I
> think all your comments are still intact.  If I have inadvertantly deleted
> anyting you would rather I have included, please let me know and I will
> amend it as you wish.

You need to put back the commented section at the top, that gives
instructions for use, and (most importantly) links to the license. Since you
are not making any changes to the script code itself, you should just use
the script file, without removing anything at all. If you use an exact copy
of the script file as it appears on my site, it will work.
FromEric Brannan
ToMe
SubjectRe: Problem running Falling Snow Script
Date22 December 2006 20:39
Tarquin,

Thanks again.  Done as you said the links to your site and licence are
there.  The bits I removed are the following lines at the top of the code
page:
              AND NOW THE CODE:
*/
as these lines gave specific errors in Opera's Error Console and prevent
the effect from running. Is that OK, or do you need them to be reinstated? I
have just tried replacing them again and their inclusion definitely stops
the script from working.

Eric
FromMe
ToEric Brannan
SubjectRe: Problem running Falling Snow Script
Date22 December 2006 23:29
Eric,

> The bits I removed are the following lines at the top of
> the code page: ... as these lines gave specific
> errors in Opera's Error Console and prevent the effect from running.

They _really_ shouldn't. The script works perfectly fine when running on my
site, and there is no reason why the exact same script file should not work
on your site.

But if that is the only way you can get it to work, then ok. But I am at a
loss to understand why you are unable to just take an exact copy of the file
from my site, and serve it from your own. I even live edited the file in
Opera while it was on your site to put the correct content in it, and it
worked just fine.

But if you are sure that you have not made any mistakes when putting the
code back in the file, then I can only assume there is a problem with your
server malforming the content while trying to send it (such as if the server
is trying some weird processing on it, treating it as a server side script
or something). Blame the server - it will make you feel better in any case
;)
FromEric Brannan
ToMe
SubjectRe: Problem running Falling Snow Script
Date23 December 2006 10:11
Tarquin,

Just tried it again - just to be sure - this time a direct cut and paste of
your script.  The effect has stopped working again and here are the errors I
receive from the Opera Error Console:

JavaScript - [URL]
Inline script compilation
Syntax error while loading: line 1 of linked script at [URL]:
AND NOW THE CODE:
--------^
JavaScript - [URL]
Inline script compilation
Syntax error while loading: line 1 of linked script at [URL]:
AND NOW THE CODE:
--------^

If I remove "AND NOW THE CODE", but leave the next line "*/", I get a
similar message with */ as the syntax error.

I have tried to run the site both locally and throught the server using 4
different browsers but with no joy.  As it was working for you, I imagine it
shouldn't be a conflict with my site.  As you say, perhaps a server-side
issue, but can't imagine why that would be the case.

I would like to run the script on my site for the next few weeks as I really
like it, but as I can only get it to run with the above 2 lines removed, I
would like to alter it in that way.  It sounds from your last msg that you
would authorise such an alteration.  Please let me know if this is
unacceptable and I will remove the script, or let me know if you would like
me to add a comment indicating the changes I had to make.

Thanks for your help and support, and for a terrific educational site - I
plan to visit it often!

Regards,
Eric
FromMe
ToEric Brannan
SubjectRe: Problem running Falling Snow Script
Date23 December 2006 10:27
Eric,

> As you say, perhaps a server-side issue, but can't imagine why that would
> be the case.

Well, maybe it thinks that <script* inside a .js file (which is in my
comments) should be processed as ASP, since ASP can be processed inside
special script tags too. Most ASP servers have only specific file extensions
(asp, aspx) associated with ASP processing, but yours may have _all_ file
types. This will be placing extra undesired load on your server, so if this
is the case, you may want to get it fixed.

> It sounds from your last msg that you would authorise such an alteration.

Yep. I do not want a server issue to prevent you using the script. Please
just make sure that there is a comment in the script saying the author name,
and the two links that say where the script comes from, and where the
license can be found.

Enjoy.
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.