如何在C#设计的网站中使用javascript [英] How use javascript in web site designed by c#
本文介绍了如何在C#设计的网站中使用javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在由c#设计的网站中的Java代码下面编写
How can I write below java code in my web site which designed by c#
<script type="text/javascript">
txt = "Browser CodeName: " + navigator.appCodeName;
txt+= "Browser Name: " + navigator.appName;
txt+= "Browser Version: " + navigator.appVersion;
txt+= "Cookies Enabled: " + navigator.cookieEnabled;
txt+= "Platform: " + navigator.platform;
txt+= "User-agent header: " + navigator.userAgent;
document.getElementById("example").innerHTML=txt;
</script>
推荐答案
将其粘贴到您选择的.aspx页面中,并确保在同一位置带有"example"的HtmlElement ID页面.
Paste it into the .aspx page of your choice and make sure you''ve got a HtmlElement ID''d with "example" on the same page.
这篇关于如何在C#设计的网站中使用javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文