admin管理员组文章数量:1317909
I saw this deface from anonymous, so I want to add a hidden chiptune song when playing the game, but got kinda lost.
<script type="text/javascript" src=".js"></script>
<script type="text/javascript">
var success = function() {
document.body.style.backgroundImage = "url(.jpg)";
document.body.style.backgroundSize = "100%";
if(window.KICKASSGAME){window.KICKASSGAME.menuManager.menu.messageTypeChangeShip('242,0');
window.KICKASSGAME.menuManager.destroy()}else{
alert("AntiSec CAEK-mode activated... Destroy the system! Controls: up, down, left, right, space to fire.");
var KICKASSVERSION='2.0';
var s = document.createElement('script');
s.type='text/javascript';document.body.appendChild(s);
s.src='//hi.kickassapp/kickass.js';
void(0);}
}
var konami = new Konami(success);
</script>
I saw this deface from anonymous, so I want to add a hidden chiptune song when playing the game, but got kinda lost.
<script type="text/javascript" src="http://www.ussc.gov/include/js/konami.js"></script>
<script type="text/javascript">
var success = function() {
document.body.style.backgroundImage = "url(http://3.bp.blogspot./-vKs53Qq5mBI/T9vCsCb-irI/AAAAAAAAB8U/CZsS0iY5RjY/s1600/14685_1_other_wallpapers_anonymous.jpg)";
document.body.style.backgroundSize = "100%";
if(window.KICKASSGAME){window.KICKASSGAME.menuManager.menu.messageTypeChangeShip('242,0');
window.KICKASSGAME.menuManager.destroy()}else{
alert("AntiSec CAEK-mode activated... Destroy the system! Controls: up, down, left, right, space to fire.");
var KICKASSVERSION='2.0';
var s = document.createElement('script');
s.type='text/javascript';document.body.appendChild(s);
s.src='//hi.kickassapp./kickass.js';
void(0);}
}
var konami = new Konami(success);
</script>
Share
Improve this question
asked Mar 11, 2013 at 5:43
John DoeJohn Doe
131 gold badge1 silver badge3 bronze badges
2 Answers
Reset to default 6play
is the method you are looking for
var audioElement = document.createElement('audio');
audioElement.setAttribute('src', 'YourSong.ogg');
audioElement.load()
audioElement.addEventListener("load", function() {
audioElement.play();
}, true);
Check this out.. It may help you..!
function play_sound(url){
if(play_html5_audio){
var snd = new Audio(url);
//code
snd.play();
}else{
var sound = $("<embed id='sound' type='audio/mpeg' />");
//code
$('body').append(sound);
}
}
play_sound('beep.mp3');
Source Code found @ Automatically playing audio with HTML5 and Javascript
本文标签: htmlHow to use a javascript to autoplay a html5 audio tagStack Overflow
版权声明:本文标题:html - How to use a javascript to autoplay a html5 audio tag - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742008379a2412421.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论