I am trying to set up my website so that our jingle plays when you load the page, but as I am new to web development, I do not know how. I taught myself how to use Dreamweaver CS3, which means that I don't know all that much, escpecially about Javascript. Can anybody explain how to get music to play onload in terms that a newbie can understand?
Thanks,
Daniel
8 3879
Here's a script I got 133 days ago from acoder :). - function play() {
-
embed = document.createElement("embed");
-
embed.setAttribute("src", "soundfile.wav");
-
embed.setAttribute("hidden", true);
-
embed.setAttribute("autostart", true);
-
document.body.appendChild(embed);
-
}
-
Just change the part the says 'soundfile.wav' to source of your sound file. And just in case you don't know where to put JavaScript you could do it like this.
[HTML] <head>
<script type="text/javascript" src="script.js"></script>
</head>
<body onload="play()">
</body>
[/HTML]
And save the JavaScript in it's own file name 'script.js'.
^_^ Hope it helps, Thanks, Death
Death,
Thanks, I really appreciate it. I saw your thread, but I didn't really understand what I should do with it. You have cleared it up for me.
Thanks,
Daniel
I have a new problem, now. I put the script in my site, tested it in a couple of browsers, and it worked fine. Uploaded the new page to my site, and it doesn't work. Any ideas?
Thanks,
Daniel
Post the page code. Have you linked to any script files that you forgot to upload?
Post the page code. Have you linked to any script files that you forgot to upload?
Thanks, I found it. Stupid mistake on my part. I appreciate it.
Daniel
Glad to hear that you managed to fix it.
I am using this code and am having a problem with it. I use exactly what is posted earlier and can't get it to work in Firefox. Any ideas? Thanks
I am using this code and am having a problem with it. I use exactly what is posted earlier and can't get it to work in Firefox. Any ideas? Thanks
Welcome to TSDN!
Do you get any errors? Post a test link if you have one available.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Marian Aldenhövel |
last post by:
Hi,
I am trying to make pygame play music on windows. This simple program:
import pygame,time
pygame.init()
print "Mixer settings", pygame.mixer.get_init()
print "Mixer channels",...
|
by: Christine Forber |
last post by:
I am looking for a way to open a given html page where I want, and not
at the top of the page.
This is for an intranet, not the www. I use a core application which
takes templates containing...
|
by: gallery |
last post by:
Our client insists on having a music loop playing as the visitor travels
throughout his new HTML website.
We will not be doing this in frames and I would prefer not to have the home
page spawn...
|
by: Just Me |
last post by:
If I use the
shell32q.NameSpace(k)
and the Parent property I can develop, for example, the path to My Music.
Actually it ends with Desktop but Desktop can also be traced by using Parent
to...
|
by: Doug van Vianen |
last post by:
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...
|
by: gnarl |
last post by:
Hello all,
I'm developing a site in PHP4 for a music artist, who wants music to
play across all their pages. I have loaded a simple flash applet to
play the music, but every time the visitor to...
|
by: FlashForumKB |
last post by:
Here is a chance for you to make my developers look bad.
I have hired these guys to development my website which, in part, has music demos available to my users. These demos must include the...
|
by: Suresh P |
last post by:
Hi All,
Is there any way other than frames to play music in the background of
the website without restart while navigating to different pages of the
website.
Because, frames will affect the...
|
by: Death Slaught |
last post by:
I need a function that plays a song in the background ( in other words the user can't stop/start the music they have to go to another page or listen to it )
I'm not the greatest at JavaScript I...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
| |