473,503 Members | 1,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JavaScript stops background music

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
4 3864
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2521
by: Andy Fish | last post by:
Hi, I want to use an anchor tag to invoke some javascript and I've read that it's bad form to use <a href="javascript:foo()"> I've read endless usenet posts and hint sites on the net, they all...
4
9590
by: Peter | last post by:
I've embedded a midi file as background sound in my "index.html" which links to other pages on the site and I want the the same background sound to play on all pages "without interruption (and...
2
2647
by: Con | last post by:
Hi, I'm getting the following error message in the JavaScript console: Error: mus has no properties Source File: file:///G:/temp/cafedub.htm Line: 35 Now, I would like to script to work in...
2
2116
by: mstearne | last post by:
Has anyone seen any Javascript that mimics the effect that allows you to browse through the New Releases, Just Added sections of the iTunes Music Store? Where you click the arrow icon and the next...
8
3622
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
7
13454
by: Tarik Monem | last post by:
Here's the latest snag in the code: I was able to retrieve data from the most of the xml files except for the xml files that contain attributes but I have yet to find a tutorial that explains the...
8
5192
by: Mateusz Viste | last post by:
Hi, I'm not sure if my question is really related to JavaScript, so please excuse me if that's not the case (and maybe you guys would have an idea what's the cause is and where could I ask)... ...
2
4393
by: ventsislav | last post by:
I want to have a background music to my simple app and a buton which plays another sound, but when I press the button the sound from it interrupts the background sound. I tried with SoundPlayer and...
0
7282
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
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6995
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...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.