JavaScript stops background music

  • Thread starter Doug van Vianen
  • Start date
D

Doug van Vianen

Hi,

I am using Visual Basic 6 to generate web pages that can be used by the
members of our seniors' computer club to create e-cards that include their
own pictures. I wish to include background music.

The music plays okay until the viewer clicks to cause some JavaScript code
to execute. When the JavaScript code runs it stops the music even though the
coding is just used to resize pictures and divs on the page (viz, it is not
supposed to do anything with the music). Can someone suggest a way to have
the music play even after the JavaScipt coding is executed?

Also, I am using midi music files which, of course, are not as pleasing as
regular mp3 or other files. However, I wish to keep the downloading as easy
as possible. Are there any better ideas? What kind of music files should or
can I use? Is there a best way to include music in a web page?

Thank you.

Doug vV
 
T

Thomas 'PointedEars' Lahn

Doug said:
I am using Visual Basic 6 to generate web pages that can be used by the
members of our seniors' computer club to create e-cards that include their
own pictures. I wish to include background music.

The music plays okay until the viewer clicks to cause some JavaScript code
to execute. [...]

Probably abusing the `javascript:' pseudo-protocol in the `href' attribute
of the `a' element is causing the browser to access another resource and so
to discontinue accessing the resources referred to by the current document,
including background sounds.

<URL:http://jibbering.com/faq/#FAQ4_24>


PointedEars
 
R

Randy Webb

Thomas 'PointedEars' Lahn said the following on 1/8/2006 2:57 PM:
Doug van Vianen wrote:

I am using Visual Basic 6 to generate web pages that can be used by the
members of our seniors' computer club to create e-cards that include their
own pictures. I wish to include background music.

The music plays okay until the viewer clicks to cause some JavaScript code
to execute. [...]


Probably abusing the `javascript:' pseudo-protocol in the `href' attribute

That is not an "abuse" but rather a "mis-use" of it.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.
 
D

Doug van Vianen

Hi,

Actually the code I am using to play the music is

<embed src="furelse.mid" autostart="true" loop="true" width="2" height="0">

</embed>

<noembed>

<bgsound src="furelse.mid" loop="infinite">

</noembed>

So I do not think that I am trying to access another document. Any other
suggestions?

Doug van Vianen



Thomas 'PointedEars' Lahn said:
Doug said:
I am using Visual Basic 6 to generate web pages that can be used by the
members of our seniors' computer club to create e-cards that include
their
own pictures. I wish to include background music.

The music plays okay until the viewer clicks to cause some JavaScript
code
to execute. [...]

Probably abusing the `javascript:' pseudo-protocol in the `href' attribute
of the `a' element is causing the browser to access another resource and
so
to discontinue accessing the resources referred to by the current
document,
including background sounds.

<URL:http://jibbering.com/faq/#FAQ4_24>


PointedEars
 
R

RobG

Doug van Vianen wrote:

Please don't top-post, reply below trimmed quotes.
Hi,

Actually the code I am using to play the music is

<embed src="furelse.mid" autostart="true" loop="true" width="2" height="0">


The replies were not in regard to how you play the music, but how you
call the script when 'the viewer clicks to cause some JavaScript code
to execute'.


[...]
Doug van Vianen wrote:

I am using Visual Basic 6 to generate web pages that can be used by the
members of our seniors' computer club to create e-cards that include
their
own pictures. I wish to include background music.

The music plays okay until the viewer clicks to cause some JavaScript
code
to execute. [...]

Probably abusing the `javascript:' pseudo-protocol in the `href' attribute
of the `a' element is causing the browser to access another resource and
so
to discontinue accessing the resources referred to by the current
document,
including background sounds.

<URL:http://jibbering.com/faq/#FAQ4_24>

What Thomas is saying is that if your script is activated using an A
element something like:

<a href="javascript:doSometing()" ...>blah</a>

or

<a href="javascript:void(0) onclick="doSometing()" ...>blah</a>


That is most probably your problem. If not, post a minimal example that
displays the behaviour or a link to the problematic page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,981
Messages
2,570,187
Members
46,729
Latest member
ScarlettJe

Latest Threads

Top