Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to write pretty URL based from data?

How to write pretty url from these data?
I need something like this https://mywebsite.com/admin/leads/count/data1/data2/data3

Thanks in advance. 🙂

var x = {data1, data2, data3};

$.ajax({
  url: 'https://mywebsite.com/admin/leads/count/',
  data: x,
    type: 'GET',
    contentType: "application/x-www-form-urlencoded",
    datatype: "json",
    async: false,
    success: function(data){ 
      $("#leads_count").val(data);
      leadsCtr = data;
    }
});

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Take url as a string and manipulate it like this

    var x = {data1, data2, data3};
    var string = 'https://mywebsite.com/admin/leads/count/';
    var fstring = string+x.data1+'/'+x.data2+'/'+x.data3;
    $.ajax({
    url: fstring,
    data: x,
    type: 'GET',
    contentType: "application/x-www-form-urlencoded",
    datatype: "json",
    async: false,
    success: function(data){ 
  $("#leads_count").val(data);
  leadsCtr = data;
}

});

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading