最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

JavascriptJQuery: set a request attribute - Stack Overflow

programmeradmin6浏览0评论

With var test = "${attributename}"; is possible to get the request attribute "attributename" from javascript/jquery.

Is there a way to set a request attribute in a similar way in javascript/jquery?

With var test = "${attributename}"; is possible to get the request attribute "attributename" from javascript/jquery.

Is there a way to set a request attribute in a similar way in javascript/jquery?

Share Improve this question asked Jul 27, 2013 at 12:46 Sefran2Sefran2 3,58813 gold badges73 silver badges108 bronze badges 1
  • @Stano: I'm using struts 1.3. I need to set a form property according to an ajax call response. I succeed in doing it: in the success callback I replace a div with another one in the response (this div contains the form property field properly setted). But I have some side effects, so I wanted to resolve in another way, for example by setting a request attribute in the success callback. – Sefran2 Commented Jul 27, 2013 at 13:08
Add a ment  | 

2 Answers 2

Reset to default 1
set a request attribute in a similar way in javascript/jquery

NO.

Request and response available on server side ...you cannot access in javascript.

var test = "${attributename}";

resolves on pile time at server side.

You might misunderstand that jsp and javascript existed on same document.Yes but JSP part piles on server side itself es to client.

I did'nt get your intention here, that while sending request,set parameter and do a request.No matter weather it is Ajax,Html form ..etc

Your question wasn't phrased too clearly, but if you are looking to get/set the request parameters of the url... take a look at the following posts:

Get a request parameter from the current url: How can I get query string values in JavaScript?

And set a request parameter: Adding a parameter to the URL with JavaScript

发布评论

评论列表(0)

  1. 暂无评论