Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
238 views
in Technique[技术] by (71.8m points)

如何在JS中获取request对象我想通过request.getattribute取值

别跟我说<%=request.getAttribute("aaa");%>我说的是在JS文件中不是JSP


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

没明白你的意思。

如果你是用JavaScript写服务端,是有request对象的,你可以查 nodejs http的api

如果你是服务端返回的数据,在前端页面或页面引入的js文件来获取的话。是没有这个东西的。
服务端已经返回数据了,js只能获取响应的数据。如果是ajax的,返回的数据都在$.ajax(...).done(function(data){// todo}) 中的data里。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...