My Home Page Only Plays The Intro Monologue The First Time You Load It

A little over a year ago I told a friend from work about my home page, and gave him the URL. The next day my friend told me he visited my website, enjoyed it, but had one piece of criticism; don't play the intro monologue every time the home page loads. The objection being that once you heard the monologue, it was irritating to keep hearing it over and over again. My thought was that if you didn't want to hear the monologue, just stop it with the <audio> tag controls.

Several blogs back, http://community-info.org/ShowMoreButton.html , I wrote about how searching for a job caused me to modify one of my web pages, http://community-info.org/mp3iFrame.html This is another one of those blogs, because I just made the change to my home page that my aforementioned friend suggested, because of some job interviews I've had. E.g., I received an invitation to an interview for a programmer/analyst job, and the requester's e-mail sounded very upbeat, but when I got to the interview (1 week later) the interviewer seemed very negative. It couldn't have been because he had reviewed my resume, because it was my resume that made him setup an interview in the first place. Maybe the interviewer found something on the web, like my home page, that he didn't like about me.

I had another interview, about a month ago, that lasted a few hours. The interviewer gave me a technical test; passed that, so the interview proceeded. The interviewer asked me a bunch of technical questions; that went well, too. The interviewer then asked me my views on some technical issues; he was in agreement with my views! Next the interviewer tried getting a feel about how I'd fit in with his company. I didn't get an offer, but the interviewer told me he was going to interview everybody he had setup an interview with, and that was going to take another week. He also told me that he would probably take another week to make a hiring decision. Two weeks later I received an e-mail telling me I wasn't selected for the job, but another qualified candidate was. Another qualified candidate? The interviewer was telling me that I was qualified, but not chosen.


I've actually been to several other interviews of late, that have all had me wondering why I wasn't hired. I thought back to what my friend from work had told me about my website, and removed the autoplay argument from my <audio> tag; now the intro doesn't play when the page loads. ...but I still want to play the intro the first time the page loads. My home page deposits a cookie on your computer, with a counter of how many times you've visited; the counter is inced with every page reload. When the counter has a value of "1", I execute a JavaScript command, "play":

function displayCounter() 
{
    var jukebox = document.getElementById("jukebox");
    if (counter > 0)
   {
      if (counter == 1)
      {
          change6("You have visited this site " + counter + " time");
          jukebox.play();    //jukebox is the id of my <audio> tag
      }
      else
      {
          change6("You have visited this site " + counter + " times"); 
      }
   } 
}

 

Of course, there is still my list of songs. Without autoplay being active, when you select a song it doesn't start on it's own. The solution is to start autoplay when a song is selected:

function changeSong()
{
   var browser;
   var songSrc;
   browser = navigator.userAgent.toLowerCase(); 
   var SongList = document.getElementById("SongList");
   var jukebox = document.getElementById("jukebox");

   if (((browser.indexOf('msie') == -1)) && (navigator.appVersion.indexOf('Trident/') <= 0))
   {
      songSrc = SongList.value;
      songSrc = songSrc.substring(0, songSrc.length - 3) + "wav"; 
      jukebox.src = songSrc; 
   }
   else
   { 
      jukebox.src = SongList.value
   }
   document.getElementById("tbl-bg").src= window.imgArr[SongList.value] 
   jukebox.autoplay = "autoplay"; 

 

That's it; changed one line of code and added two more.   ...but it took a suggestion from a friend and several job interviews to convince me I needed to make the change!

Return To My Blog Page       Return To My Programming Page