如何将src作为变量。 [英] How to give src as variable.
本文介绍了如何将src作为变量。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用servlet并在其中编写HTML代码。
I am using servlet and writing html code in it.
String audiosrc = path + "\\" + files;
out.println(audiosrc);
out.println("<audio controls>");
out.println("<source src=\" ' + audiosrc + ' \" type=\"audio/mpeg\">");
out.println("Your browser does not support the audio element.");
out.println("</audio>");
这里我已将变量作为src传递给音频,但它不工作,我想设置动态分配src值。 :/
here I have passed variable as a src for audio, but it ain't working, And I want to set the dynamically assign the src value. :/
推荐答案
请尝试如下:
Please try like below:
out.println("<scource src=\"" + audiosrc + "\" type=\"audio/mpeg\" >");
这篇关于如何将src作为变量。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文