在JavaScript和主体中使用Response.Write [英] Use Response.Write in javascript and body

查看:78
本文介绍了在JavaScript和主体中使用Response.Write的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨''
如何在JavaScript和主体中使用Response.Write
是<%=%> ASP指令的指令?并且它用在javascript和body

Hi''
How the Response.Write can be use in javascript and body
Is <%= %> an instruction of ASP instructions? AND it use in javascript and body

推荐答案

中,您的问题不是很清楚,但是您需要阅读Response.Write.

阅读: Response.Write方法 [
Your question is not quite clear but you need to read on Response.Write.

Read: Response.Write Method[^]


Now, for injecting JavaScript into HTML using Response.Write:
Response.Write("<script language="javascript">");
Response.Write("alert('Hello World!');");
Response.Write("return false;");
Response.Write("</script>");


<%= "hello!" %><% Response.Write("hello!") %>都是相同的.它们产生相同的输出.

实际上,<% %>用于执行ASP.NET服务器端语句,而<%= %>是Response.Write的快捷方式.

<% %>中,您可以编写将在运行时执行的任何服务器端代码.
谢谢,
Hemant
<%= "hello!" %> and <% Response.Write("hello!") %> both are identical. they produce same output.

Actually <% %> is used to execute ASP.NET server side statements and <%= %> is shortcut of Response.Write.

in <% %> you can write any server side code which will be executed at runtime.
Thanks,
Hemant


<%@ language="javascript"%>
<html>
<body>
<%
Response.Write("Hello World!")
%>
</body>
</html>



您可以在ASP页中使用此类javascript.



You can use javascript like this in your ASP page.


这篇关于在JavaScript和主体中使用Response.Write的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆