Is it possible to embed some java script in content of the page?
I'd like to embed some external code to view my 360VR spherical panoramas. Code is like this:
Code
<script type="text/javascript">
// hide URL field on the iPhone/iPod touch
function hideUrlBar() {
document.getElementsByTagName("body")[0].style.marginTop="1px";
window.scrollTo(0, 1);
}
window.addEventListener("load", hideUrlBar);
window.addEventListener("resize", hideUrlBar);
window.addEventListener("orientationchange", hideUrlBar);
</script>
<style type="text/css" title="Default">
.warning {
font-weight: bold;
}
/* fix for scroll bars on webkit & Mac OS X Lion */
::-webkit-scrollbar {
background-color: rgba(0,0,0,0.5);
width: 0.75em;
}
::-webkit-scrollbar-thumb {
background-color: rgba(255,255,255,0.5);
}
#container {
font-family: Verdana, Geneva, sans-serif;
height: 480px;
width: 90%;
border: 12px solid rgb(255,255,255);
margin-top: 15px;
margin-right: auto;
margin-bottom: 10px;
margin-left: auto;
box-shadow: 0px 0px 5px 4px rgb(0,0,0);
-moz-box-shadow: 0px 0px 5px 4px rgb(0,0,0);
-webkit-box-shadow: 0px 0px 5px 4px rgb(0,0,0);
overflow: hidden;
}
</style>
<script type="text/javascript" src="pano2vr_player.js">
</script>
<script type="text/javascript" src="skin.js">
</script>
<script type="text/javascript" src="pano2vrgyro.js">
</script>
<div id="container">
This content requires HTML5/CSS3, WebGL, or Adobe Flash Player Version 9 or higher.
</div>
<script type="text/javascript">
// create the panorama player with the container
pano=new pano2vrPlayer("container");
// add the skin object
skin=new pano2vrSkin(pano);
// load the configuration
pano.readConfigUrl("Sphere_out.xml");
// hide the URL bar on the iPhone
hideUrlBar();
// add gyroscope controller
gyro=new pano2vrGyro(pano,"container");
</script>
<noscript>
<p><b>Please enable Javascript!</b></p>
</noscript>