aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes What does postAction do, unable to understand the code snippet mentioned by me in this thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "What does postAction do, unable to understand the code snippet mentioned by me in this thread" Watch "What does postAction do, unable to understand the code snippet mentioned by me in this thread" New topic
Author

What does postAction do, unable to understand the code snippet mentioned by me in this thread

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1056

Hi,

I am unable to understand the below code in .js file, here is the var declared as jsonString , is it simply a variable or is it something predefined.

if jsonString is simply a variable , then how is the value assigned to it like '{"Opportunity_id" : "'+oppId+'"}';

Does that mean json is acceptiong String value?

And what does postAction mean and do?

Please note:i am using Structs framework, will postaction first search for poicr in the structs.xml file? and what is the second and third argument mentioned in postAction



http://www.lifesbizzare.blogspot.com || OCJP:81%
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

Vishal Hegde wrote:I am unable to understand the below code in .js file, here is the var declared as jsonString , is it simply a variable or is it something predefined.

jsonString is just a variable to which a string is assigned.

if jsonString is simply a variable , then how is the value assigned to it like '{"Opportunity_id" : "'+oppId+'"}';

Don't know what you are asking here. It's simply a string. It represents a JSON object.

Does that mean json is acceptiong String value?

It just means that a variable is being assigned a string.

And what does postAction mean and do?

No way of knowing. it might be a function defined elsewhere in the page, or by an included script. It is not part of standard JavaScript or the DOM API.

Please note:i am using Structs framework

You must mean Struts. Please take more care when posting.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1056

Bear Bibeault wrote:
Vishal Hegde wrote:I am unable to understand the below code in .js file, here is the var declared as jsonString , is it simply a variable or is it something predefined.

jsonString is just a variable to which a string is assigned.

if jsonString is simply a variable , then how is the value assigned to it like '{"Opportunity_id" : "'+oppId+'"}';

Don't know what you are asking here. It's simply a string. It represents a JSON object.

Does that mean json is acceptiong String value?

It just means that a variable is being assigned a string.

And what does postAction mean and do?

No way of knowing. it might be a function defined elsewhere in the page, or by an included script. It is not part of standard JavaScript or the DOM API.

Please note:i am using Structs framework

You must mean Struts. Please take more care when posting.




Thank you Bear, so json is simply taking a String, but what does json Object mean?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

JSON
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What does postAction do, unable to understand the code snippet mentioned by me in this thread