jquery - what is the meaning of "url"+"serialized form" in $.getJSON -


good day, i've started using ajax in jquery. meaning of "url"+"serialized form" in $.getjson? thank in advance!

this not $.getjson thing jquery function query string of form field values.

for example:

<form action="javascript:alert('ok');" method=”get”>   <div>     <input type="text" name="field1" />     <input type="text" name="field2" />     <input type="submit" />   </div> </form> 

a $('form').serialize(); return field1=<value>&field2=<value>

so in example mentioned, must have been used generate url json needs fetched. example, if have base url:

var url = 'https://example.com/some-path?q=something'; 

and want add parameters values in form:

$.getjson(url + $('form').serialize(), function(json) {   .... }); 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -