Help with random script...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Franklin P Patchey

    #1

    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="JavaS cript">
    <!-- hiding
    page=new Date();
    if (page.getDate() == 1)
    document.write( "<embed src='media/audio/waltzinblack.mp 3' 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.m p3' 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.mp 3' 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.mp 3' 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.mp 3' 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.mp 3' width='145'
    height='60' autostart='true ' hidden='true' loop='false' volume='70'>");

    if (page.getDate() == 22)
    document.write( "<embed src='media/audio/theuniversal.mp 3' 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/blackpolishedch rome.mp3' width='145'
    height='60' autostart='true ' hidden='true' loop='false' volume='70'>");

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

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

    if (page.getDate() == 27)
    document.write( "<embed src='media/audio/waltzinblack.mp 3' 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.mp 3' width='145'
    height='60' autostart='true ' hidden='true' loop='false' volume='70'>");

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

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


  • Fabian

    #2
    Re: Help with random script...

    Franklin P Patchey hu kiteb:
    [color=blue]
    > 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 ("")[/color]
    ....[color=blue]
    > document.write( "") -------------THIS BIT HERE!!![/color]

    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!
    Penasaran slot depo 10k di AGAM69? Simak pengalaman main Mahjong Ways dan buy spin modal receh yang berakhir manis. Daftar dan buktikan sendiri.


    Comment

    • Lee

      #3
      Re: Help with random script...

      Franklin P Patchey said:[color=blue]
      >
      >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
      >("")[/color]
      [color=blue]
      >...
      >page=new Date();
      >
      >document.write ("") -------------THIS BIT HERE!!!
      >//done hiding -->
      ></SCRIPT>[/color]

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

      Comment

      • Lee

        #4
        Re: Help with random script...

        Fabian said:[color=blue]
        >
        >Franklin P Patchey hu kiteb:
        >[color=green]
        >> 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 ("")[/color]
        >...[color=green]
        >> document.write( "") -------------THIS BIT HERE!!![/color]
        >
        >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.[/color]

        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>");

        Comment

        • Dr John Stockton

          #5
          Re: Help with random script...

          JRS: In article <bns51e01ha6@dr n.newsguy.com>, seen in
          news:comp.lang. javascript, Lee <REM0VElbspamtr ap@cox.net> posted at Thu,
          30 Oct 2003 14:57:50 :-[color=blue]
          >Fabian said:[color=green]
          >>
          >>Franklin P Patchey hu kiteb:
          >>[color=darkred]
          >>> 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 ("")[/color]
          >>...[color=darkred]
          >>> document.write( "") -------------THIS BIT HERE!!![/color]
          >>
          >>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.[/color][/color]

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

          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.

          [color=blue]
          >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>");[/color]

          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 = ["", "waltzinbla ck", ..., "twilightzo ne"]

          --
          © 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.demo n.co.uk/js-index.htm> JS maths, dates, sources.
          <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.

          Comment

          • Franklin P Patchey

            #6
            Re: Help with random script...

            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'>");


            Comment

            • Fabian

              #7
              Re: Help with random script...

              Franklin P Patchey hu kiteb:
              [color=blue]
              > 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'>");[/color]

              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!
              Penasaran slot depo 10k di AGAM69? Simak pengalaman main Mahjong Ways dan buy spin modal receh yang berakhir manis. Daftar dan buktikan sendiri.


              Comment

              • Dr John Stockton

                #8
                Re: Help with random script...

                JRS: In article <bnujqr$h7h$1@n ews7.svr.pol.co .uk>, seen in
                news:comp.lang. javascript, Franklin P Patchey
                <REMOVETHIS1010 01@talk21.com> posted at Fri, 31 Oct 2003 21:22:27 :-[color=blue]
                >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?[/color]

                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.demo n.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)

                Comment

                • Fabian

                  #9
                  Re: Help with random script...

                  Dr John Stockton hu kiteb:
                  [color=blue]
                  > 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.[/color]

                  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!
                  Penasaran slot depo 10k di AGAM69? Simak pengalaman main Mahjong Ways dan buy spin modal receh yang berakhir manis. Daftar dan buktikan sendiri.


                  Comment

                  • Franklin P Patchey

                    #10
                    To Dr John Stockton.

                    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" <lajzar@hotmail .com> wrote in message
                    news:bo1evq$153 r1a$2@ID-174912.news.uni-berlin.de...[color=blue]
                    > Dr John Stockton hu kiteb:
                    >[color=green]
                    > > 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.[/color]
                    >
                    > 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
                    >[/color]


                    Comment

                    • Fabian

                      #11
                      Re: To Dr John Stockton.

                      Franklin P Patchey hu kiteb:
                      [color=blue]
                      > Nice one Fabian!
                      > ... I pay you a
                      > compliment that your shortened script is better and you reply with
                      > rudeness - what's going on there?[/color]

                      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!
                      Penasaran slot depo 10k di AGAM69? Simak pengalaman main Mahjong Ways dan buy spin modal receh yang berakhir manis. Daftar dan buktikan sendiri.


                      Comment

                      • Franklin P Patchey

                        #12
                        Re: To Dr John Stockton.

                        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" <lajzar@hotmail .com> wrote in message
                        news:bo2svt$17f uks$1@ID-174912.news.uni-berlin.de...[color=blue]
                        > Franklin P Patchey hu kiteb:
                        >[color=green]
                        > > Nice one Fabian!
                        > > ... I pay you a
                        > > compliment that your shortened script is better and you reply with
                        > > rudeness - what's going on there?[/color]
                        >
                        > 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
                        >[/color]


                        Comment

                        • Dr John Stockton

                          #13
                          The Wisdom of Franklin P Patchey

                          JRS: In article <bo2t8c$knh$1@n ewsg1.svr.pol.c o.uk>, seen in
                          news:comp.lang. javascript, Franklin P Patchey
                          <REMOVETHIS1010 01@talk21.com> posted at Sun, 2 Nov 2003 12:27:46 :-[color=blue]
                          >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.[/color]

                          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.demo n.co.uk/js-index.htm> JS maths, dates, sources.
                          <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.

                          Comment

                          Working...