Include Unity Script into HTML

I have a game script which I would like to integrate in my site.

Can someone explain how I include correctly a unity script in my html page?

Are you asking how to embed a unity player in html? or a actual script for the unity player?

If your trying to embed a player take a look at the html thats generated when you build for web.

If your trying to make a script in html for unity i don’t think you can. It might be supported to do a AssetBundle with scripts (i’m not sure) but since unity script and any other language in unity is compiled i don’t think you can just take some text and send it to unity to compile as script at runtime with the web player

Welcome to the forums

Embedding is as BDev explained. However, if you wish to carry out Unity functions in Javascript or have the Javascript receive data from Unity. I suggest looking at the documentation:

http://unity3d.com/support/documentation/Manual/Unity%20Web%20Player%20and%20browser%20communication.html

No, scripts aren’t supported in AssetBundles.

Actually you can, by using eval(), which compiles plain text to code at runtime.

–Eric