play sound ,javascript refactor

This commit is contained in:
yifang 2022-01-03 12:00:50 +08:00
parent d5af210785
commit 0a54477435
2 changed files with 4 additions and 4 deletions

View file

@ -709,10 +709,6 @@ void ArticleRequest::bodyFinished()
head += "<script type=\"text/javascript\">var gdArticleContents; "
"if ( !gdArticleContents ) gdArticleContents = \"" + jsVal +" \"; "
"else gdArticleContents += \"" + jsVal + " \";"
"function playSound(sound){"
" var a=new Audio(sound);"
" a.play();"
"}"
"</script>";
head += string( "<div class=\"gdarticle" ) +

View file

@ -21,3 +21,7 @@ $(function() {
}
);
function playSound(sound) {
var a = new Audio(sound);
a.play();
}