<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body >
<button onclick="me('${message}');">hello</button>
<div id="play">
</div>
<div id="p">
</div>
</body>
<script type="text/javascript">
function me(mes)
{
switch(mes){
case 'Knowing our Numbers':
$("#p").append("<object id='objViewer' name='f' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='550' height='400' id='intro to elianas website' align='middle'>"+
"<param name='allowScriptAccess' value='sameDomain' />"+
"<param name='movie' width=400px height=400px value='test1.swf' />"+
"<param name='quality' value='high' />"+
"<param name='bgcolor' value='#1C140D' />"+
"<EMBED src='test1.swf' WIDTH='400px' HEIGHT='400px' quality='high' TYPE='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' NAME='intro' id='player' autostart='false' allowScriptAccess='sameDomain' ShowControls='1' ShowStatusBar='0' ShowDisplay='0' ></EMBED><br/></object>"
);
alert(mes);
break;
case 'Whole Numbers':
alert(mes);
break;
}
}
</script>
</html>
工作在上面的代码我试图追加在case语句中的HTML代码,但它不工作。如何我可以使用case语句里面的HTML代码和基于我需要提前追加不jQuery的
您需要添加jQuery库中的代码为.append是jQuery中没有的JavaScript的功能。 –