Can I post JSON without using AJAX?

后端 未结 5 802
不思量自难忘°
不思量自难忘° 2021-01-12 15:35

I have some data, lets say:

var dat = JSON.stringify(frm.serializeArray())

I want to submit this to the server using a roundtrip (aka, non

5条回答
  •  旧时难觅i
    2021-01-12 16:06

    You would need to assign the json string to an input's value inside a form tag in order for it to get POSTed to the server (either by the user submitting the form or by clicking the submit button programmatically).

    Alternatively from javascript you could use window.location to send the variable as part of a GET request.

提交回复
热议问题