473,395 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Help with random script...

I have modified some script and think i have put a bit in that isn't
"compliant"
Is the bit marked below (towards the end) correct - should it be () and not
("")

<SCRIPT LANGUAGE="JavaScript">
<!-- hiding
page=new Date();
if (page.getDate() == 1)
document.write("<embed src='media/audio/waltzinblack.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 2)
document.write("<embed src='media/audio/littlegreenbag.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 3)
document.write("<embed src='media/audio/rockthecasbah.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 4)
document.write("<embed src='media/audio/softparade.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 5)
document.write("<embed src='media/audio/cematinla.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 6)
document.write("<embed src='media/audio/venusinfurs.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 7)
document.write("<embed src='media/audio/allineed.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 8)
document.write("<embed src='media/audio/heroin.mp3' width='145' height='60'
autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 9)
document.write("<embed src='media/audio/grooveme.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 10)
document.write("<embed src='media/audio/totu.mp3' width='145' height='60'
autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 11)
document.write("<embed src='media/audio/monstermash.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 12)
document.write("<embed src='media/audio/twilightzone.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 13)
document.write("<embed src='media/audio/sundaygirl.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 14)
document.write("<embed src='media/audio/theuniversal.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 15)
document.write("<embed src='media/audio/closetome.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 16)
document.write("<embed src='media/audio/kungfufighting.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 17)
document.write("<embed src='media/audio/youandmesong.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 18)
document.write("<embed src='media/audio/totu.mp3' width='145' height='60'
autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 19)
document.write("<embed src='media/audio/americanbeauty.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 20)
document.write("<embed src='media/audio/closetome.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 21)
document.write("<embed src='media/audio/hourformagic.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 22)
document.write("<embed src='media/audio/theuniversal.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 23)
document.write("<embed src='media/audio/themovie.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 24)
document.write("<embed src='media/audio/blackpolishedchrome.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 25)
document.write("<embed src='media/audio/stonedimmaculate.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 26)
document.write("<embed src='media/audio/rockthecasbah.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 27)
document.write("<embed src='media/audio/waltzinblack.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 28)
document.write("<embed src='media/audio/sundaygirl.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 29)
document.write("<embed src='media/audio/allineed.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 30)
document.write("<embed src='media/audio/youandmesong.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");

if (page.getDate() == 31)
document.write("<embed src='media/audio/twilightzone.mp3' width='145'
height='60' autostart='true' hidden='true' loop='false' volume='70'>");
page=new Date();

document.write("") -------------THIS BIT HERE!!!
//done hiding -->
</SCRIPT>
Jul 20 '05 #1
12 1951
Franklin P Patchey hu kiteb:
I have modified some script and think i have put a bit in that isn't
"compliant"
Is the bit marked below (towards the end) correct - should it be ()
and not ("") .... document.write("") -------------THIS BIT HERE!!!


Isn't the intended functionality equivalent to having nothing at all for
that line of code? If you want a carriage return written, use \n as an
escape character. I can't imagine any instance in which a write
statement makes sense with a null value.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #2
Lee
Franklin P Patchey said:

I have modified some script and think i have put a bit in that isn't
"compliant"
Is the bit marked below (towards the end) correct - should it be () and not
("") ...
page=new Date();

document.write("") -------------THIS BIT HERE!!!
//done hiding -->
</SCRIPT>


That line doesn't do anything, anyway. Take it out.
The line just before it [page=new Date()] doesn't serve any
purpose, either.

Jul 20 '05 #3
Lee
Fabian said:

Franklin P Patchey hu kiteb:
I have modified some script and think i have put a bit in that isn't
"compliant"
Is the bit marked below (towards the end) correct - should it be ()
and not ("")

...
document.write("") -------------THIS BIT HERE!!!


Isn't the intended functionality equivalent to having nothing at all for
that line of code? If you want a carriage return written, use \n as an
escape character. I can't imagine any instance in which a write
statement makes sense with a null value.


A carriage return would still be nearly equivalent to nothing at all,
since it displays in HTML as a single white-space character.

To get a line break, use:

document.write("<br>");

Jul 20 '05 #4
JRS: In article <bn*********@drn.newsguy.com>, seen in
news:comp.lang.javascript, Lee <RE**************@cox.net> posted at Thu,
30 Oct 2003 14:57:50 :-
Fabian said:

Franklin P Patchey hu kiteb:
I have modified some script and think i have put a bit in that isn't
"compliant"
Is the bit marked below (towards the end) correct - should it be ()
and not ("")...
document.write("") -------------THIS BIT HERE!!!


Isn't the intended functionality equivalent to having nothing at all for
that line of code? If you want a carriage return written, use \n as an
escape character. I can't imagine any instance in which a write
statement makes sense with a null value.


If one wants a CR, CRLF, or newline written, one uses
document.writeln().

An empty string is not a null value.

Writing a literal empty string is pointless as such; but it might occur
as a result of automated code generation.

A carriage return would still be nearly equivalent to nothing at all,
since it displays in HTML as a single white-space character.

To get a line break, use:

document.write("<br>");


Not necessarily in general, it might be in <pre>; although not in this
case.
More importantly, there seems to be 31 statements identical except for
the file name; the lot should be replaceable by a single statement

document.write("<embed src='media/audio/", FileName[page.getDate()] ,
".mp3' width='145' height='60' autostart='true' hidden='true'",
" loop='false' volume='70'>");

after

FileName = ["", "waltzinblack", ..., "twilightzone"]

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Jul 20 '05 #5
I like Dr John's idea on the short version of what I have copied (I don't
understand javascript really, so please treat me as thick!)

where do I insert the filenames of my mp3's so the script knows what to
play?
---------
What goes at the beginning here too?
document.write("<embed src='media/audio/", FileName[page.getDate()] ,
".mp3' width='145' height='60' autostart='true' hidden='true'",
" loop='false' volume='70'>");
Jul 20 '05 #6
Franklin P Patchey hu kiteb:
I like Dr John's idea on the short version of what I have copied (I
don't understand javascript really, so please treat me as thick!)

where do I insert the filenames of my mp3's so the script knows what
to play?
---------
What goes at the beginning here too?
document.write("<embed src='media/audio/", FileName[page.getDate()] ,
".mp3' width='145' height='60' autostart='true' hidden='true'",
" loop='false' volume='70'>");


Wouldnt a better idea be to have the javascript write a link to the file
instead? That way, the user can choose how much bandwidth your site will
consume. The smallest mp3 of listenable quality I have seen is about
half a meg. That is non-trivial on anything less than a cable
connection.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #7
JRS: In article <bn**********@news7.svr.pol.co.uk>, seen in
news:comp.lang.javascript, Franklin P Patchey
<RE**************@talk21.com> posted at Fri, 31 Oct 2003 21:22:27 :-
I like Dr John's idea on the short version of what I have copied (I don't
understand javascript really, so please treat me as thick!)

where do I insert the filenames of my mp3's so the script knows what to
play?
---------
What goes at the beginning here too?


You're posting via pol.co.uk, so you should understand English. Read
all that I wrote, considering the exact meanings of all of the words.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Plaintext, quoting : see <URL:http://www.usenet.org.uk/ukpost.html>
Do not Mail News to me. Before a reply, quote with ">" or "> " (SoRFC1036)
Jul 20 '05 #8
Dr John Stockton hu kiteb:
You're posting via pol.co.uk, so you should understand English. Read
all that I wrote, considering the exact meanings of all of the words.


And I'm posting from a German news server, so I suppose that means I
should understand German?

Or perhaps if I used my ISP's extraordinarily flaky Japan-based server,
would that make me fluent in Japanese?
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #9
Nice one Fabian!
I have noticed that a lot of people in this newsgroup (and others) attempt
to be helpful, but at the same time intensely condescending and short
sighted. A typical computer obsessive (John Stockton).
No I don't understand and don't mind admitting it. I pay you a compliment
that your shortened script is better and you reply with rudeness - what's
going on there?

Just because I understand English doesn't mean I will understand a computer
code that I have no idea about. I lifted the original script from
Bravenet.com on their help pages. I don't know how to modify it so it is
shorter but still works and you shouldn't assume that just because I
understand English and am posting in a PC newsgroup that I understand
everything about computers including Javascript.

I don't want you opinions, just help with the script. If you are going to
give it then thank you, if not then just don't reply at all - be a rational,
reasonable adult!

"Fabian" <la****@hotmail.com> wrote in message
news:bo*************@ID-174912.news.uni-berlin.de...
Dr John Stockton hu kiteb:
You're posting via pol.co.uk, so you should understand English. Read
all that I wrote, considering the exact meanings of all of the words.


And I'm posting from a German news server, so I suppose that means I
should understand German?

Or perhaps if I used my ISP's extraordinarily flaky Japan-based server,
would that make me fluent in Japanese?
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #10
Franklin P Patchey hu kiteb:
Nice one Fabian!
... I pay you a
compliment that your shortened script is better and you reply with
rudeness - what's going on there?


I'm confused. I don't recall seeing any replies from you on the matter
of my shortened script. And I don't recall writing a rude response to
you. I would be pleased if you would highlight what exactly I wrote to
you that you consider so rude.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #11
No you didn't. I am referring to Dr John Stockton saying that as I'm posting
from a UK server that I should understand English. You weren't rude the Dr
guy

"Fabian" <la****@hotmail.com> wrote in message
news:bo*************@ID-174912.news.uni-berlin.de...
Franklin P Patchey hu kiteb:
Nice one Fabian!
... I pay you a
compliment that your shortened script is better and you reply with
rudeness - what's going on there?


I'm confused. I don't recall seeing any replies from you on the matter
of my shortened script. And I don't recall writing a rude response to
you. I would be pleased if you would highlight what exactly I wrote to
you that you consider so rude.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #12
JRS: In article <bo**********@newsg1.svr.pol.co.uk>, seen in
news:comp.lang.javascript, Franklin P Patchey
<RE**************@talk21.com> posted at Sun, 2 Nov 2003 12:27:46 :-
No you didn't. I am referring to Dr John Stockton saying that as I'm posting
from a UK server that I should understand English.


You wrote "(I don't understand javascript really, so please treat me as
thick!)". I saw no reason to disagree with the first part, so I
complied with the second part.

You should read the newsgroup FAQ with care, to find out (/inter alia/)
how news posts and replies should be formatted; it will increase your
chances of getting useful replies in future.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Jul 20 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jennie Friesen | last post by:
Hello-- I would like to display a different line of text (32 different messages) on refresh, BUT with no repeats. The script I am currently using is: <script language=javascript...
3
by: Jim Davidson | last post by:
Here's what I'm trying to do: I have a string with 30 numbers in it. I want to generate a random number between 0 an 30, go to that position in the string and get that number. Here is the code...
4
by: Phillo | last post by:
Hello, I'm new at Javascript, and have written a script for a series of random roll-over button images, but one thing I would like to add is a function that checks to make sure that there are no...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
2
by: sgMuser | last post by:
Hi, I am not a good developer of Javascript codes. Needs this help to make some modification to this famous free javascript from Anarchos. i am using this in one of my webpage. What it does is,...
1
by: ArcInversion | last post by:
Hi, I've been using a javascript script to create a dragon that flies across the page. Anyways, I'd like to make it so when you click the dragon it takes you to a new page. Was wondering if anyone...
6
by: mrtaka79 | last post by:
Okay, first of all, I'm a complete noob, so go easy on me. I have this code that works perfectly for me. The only thing I want to add is to randomize the pictures/links that show up. Can anyone...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
3
by: blogger | last post by:
i try use this script but keep getting Char: 6 Error: Expected ';' What can i do? <SCRIPT type="text/javascript"> /*Script distributed by Hypergurl.com Visit ...
9
by: DaiOz | last post by:
Hi guys im doing a course which includes some JavaScript and I need help with the following question please, The code I have so far is below but I don't think its right please help as I need...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.