我有两个 x3d 文件1.x3d
,12.x3d
我想使用一个按钮将它们加载到画布上,但我的代码似乎不起作用。我在左上角看到加载图标,但模型没有改变。
这是我的代码:-
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html;charset=utf-8'></meta>
<link rel='stylesheet' type='text/css' href='http://www.x3dom.org/x3dom/release/x3dom.css'></link>
<script type='text/javascript' src='http://www.x3dom.org/x3dom/release/x3dom.js'></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("x3d > scene > inline").attr("url", "1.x3d");
});
});
</script>
</head>
<body>
<button> Click to Change Background </button>
<x3d id='someUniqueId' showStat='false' showLog='false' x='0px' y='0px' width='400px' height='400px'>
<scene>
<inline id="myinline" url='12.x3d' ></inline>
<scene>
</x3d>
</body>
</html>