JavaScript How to make form.submit in Javascript quote delimit names and values of post data make form submit on enter,make form submit ajax,make

I need to submit a programmatically created form using plain Javascript (no JQuery).

Everything works, except the post data arrives on the server without quotes (which the C# JsonConvert.DeserializeObject() method can't parse).

It arrives as token:a987a87f9k

But I want the data to arrive as 'token':'a987a87f9k'

What should I change in this code?

var form = document.createElement("form");
form.setAttribute("id", "noid");
form.setAttribute("method", "post");
form.setAttribute("action", url);
form.setAttribute("target", tabName);
form.setAttribute("style", "display: none;");

var field = document.createElement("input");
field.setAttribute("name", 'token');
field.setAttribute("value", AccountService.GetAuthenticationToken());
form.appendChild(field);

document.body.appendChild(form);
window.open('about:blank', tabName);
form.submit();

Read server-side:

//content = "token:a987a87f9k";
var content = request.Content.ReadAsStringAsync().Result;
Answer:1

I'm using the RequireJS optimiser to minify and concatenate my code. At the moment r.js doesn't minify a lot of my scripts because of the nested dependencies. I want to include nested dependencies ...

I'm using the RequireJS optimiser to minify and concatenate my code. At the moment r.js doesn't minify a lot of my scripts because of the nested dependencies. I want to include nested dependencies ...

  1. requirejs optimizer include

I have jQuery code that calls a function as such: $('#text_area').bind('input propertychange', function() {... The element being bound to the function is a text area. When I type and delete text the ...

I have jQuery code that calls a function as such: $('#text_area').bind('input propertychange', function() {... The element being bound to the function is a text area. When I type and delete text the ...

  1. jquery function bind
  2. jquery function bind parameter
  3. jquery bind function to element
  4. jquery bind function to button
  5. jquery bind function to dynamic element
  6. jquery bind function to dynamically created element
  7. jquery bind function on click
  8. jquery bind function to event
  9. jquery bind function to multiple events
  10. jquery bind function dynamically
  11. jquery bind function after ajax load
  12. jquery bind function with arguments
  13. jquery bind function to class
  14. jquery bind function to multiple elements
  15. jquery bind function example
  16. jquery bind function name
  17. jquery bind function to button click
  18. jquery bind function to select change
  19. jquery bind function pass parameter
  20. jquery bind function not working

In my webapp client side script I'm using the OrientDB Javascript API (orientdb-api.js). When the script initializes I run this code: var orientdb = new ODatabase("http://localhost:2480/testapp"); ...

In my webapp client side script I'm using the OrientDB Javascript API (orientdb-api.js). When the script initializes I run this code: var orientdb = new ODatabase("http://localhost:2480/testapp"); ...

  1. orientdb connection timeout

I have created custom angular directive. For an example: Custom directive: var app=angular.module('app',[]); app.directive('customDirective',function(){ return{ restrict:A, controller:...

I have created custom angular directive. For an example: Custom directive: var app=angular.module('app',[]); app.directive('customDirective',function(){ return{ restrict:A, controller:...

  1. passing data from child to parent react
  2. passing data from one component to another
  3. passing data from child to parent angular
  4. passing data from parent to child
  5. passing data from controller to view
  6. passing data from php to javascript
  7. passing data from child to parent vue
  8. passing data from activity to fragment
  9. passing data from view to controller in mvc
  10. passing data from laravel to vue
  11. passing data from child to parent react hooks
  12. passing data from flask to javascript
  13. passing data from html to javascript
  14. passing data from rails to react
  15. passing data from child to child react
  16. passing data from one fragment to another
  17. passing data from controller to view laravel
  18. passing data from one lambda to another
  19. passing data from jsp to servlet
  20. passing data from iframe to parent