Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic