By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 1,035 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

JavaScript stops background music

P: n/a
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
Jan 8 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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>
PointedEars
Jan 8 '06 #2

P: n/a
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.

Jan 8 '06 #3

P: n/a
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" <Po*********@web.de> wrote in message
news:34****************@PointedEars.de...
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>
PointedEars

Jan 9 '06 #4

P: n/a
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'.
[...]
"Thomas 'PointedEars' Lahn" <Po*********@web.de> wrote in message
news:34****************@PointedEars.de...
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.
--
Rob
Jan 9 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.