简体   繁体   中英

How works embedded iframe?

Sorry if my question sounds stupid but It's kind of mystery for me. I have an iframe below which show a unity game in WebGL and I wonder where is the javascript, the shader and the game file?

 <iframe src="https://c.simmer.io/static/unityFrame/index.html?url=https%3A%2F%2Fsimmercdn.com%2Funity%2FArOcg0jhIjQgaW2bkAbPZlOkgc83%2Fcontent%2F60cfc1db-8a32-6180-7f42-19302166284e&imagePath=screens/0.png" style="width:480px;height:300px;border:0"></iframe> 

To put it simply An iframe is used to display a web page within a web page .

All the javascript, shaders or files required for the game will be loaded the same way you will use to load your own resources by using <script> , <img> ... or any necessary element to request the data.

In this case, the resources are hosted by the page you are indicating in the src element of the iframe.

For example this is one of the scripts to load the game: https://c.simmer.io/static/unityFrame/TemplateData/simmer.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM