javascript - ajax data parameter how to pass json including query-string urls -


i have problem . working on json . fine comes know if pass json containing query-string urls not work

here json example

var json='{"nodedataarray": [      {"info":"this si child 1 step 1", "link":"https://www.google.co.in?check=abc&"}      ]}';  

i sending ajax method below code

$.ajax({         url: base_url + '/createflowchart/saveflowchart',         type: 'post',         datatype: 'json',         data: "flowchartname=" + flowchartname + "&chartcode=" + chartcode + "&content=" + json,         beforesend: function() {             $('#savebutton').text('saving...');              // loading options         },         success: function(data) {             //code         },          complete: function() {             // success alerts             $('#savebutton').text('save');         },          error: function(data) {             alert("there may error on uploading. try again later");         },      }); 

now issue

if pass json containg type of url https://www.google.co.in?check=abc&check=2 split post parameter & don't want . body have idea how can achive .any appriciated

supply data parameter object , jquery encode you:

data: {     'flowchartname': flowchartname,     'chartcode': chartcode,     'content': json } 

for reason it's best practice supply data $.ajax call in object form, instead of building unsightly querystring manually.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -