jquery - How to prevent original site url from being shown on links I create -
i managed data stored in different variables , manually create link data coming variables.
my site link can see here
first select option first dropdwon, choose dates, click on black button, , afterwards, click on "nothing here", site should generate url different website.
example: www.lekkeslaap.co.za/akkommodasie-in/saab?q=saab&start=11+4+2017&end=17+4+2017&pax=2
but happening before url, giving me main site url link looking wrong: http://wordpressdev.burnnotice.co.za/www.lekkeslaap.co.za/akkommodasie-in/saab?q=saab&start=25+4+2017&end=30+4+2017&pax=3
how can prevent main site url(my site) coming before link want redirect?
i did in pen here
here js:
$(document).ready(function() { var txtfromdate, txttodate; $("#txtfrom").datepicker({ numberofmonths: 1, onselect: function(selected) { txtfromdate = selected; var dt = new date(selected); dt.setdate(dt.getdate() + 1); $("#txtto").datepicker("option", "mindate", dt); } }); $("#txtto").datepicker({ numberofmonths: 1, onselect: function(selected) { txttodate = selected; var dt = new date(selected); dt.setdate(dt.getdate() - 1); $("#txtfrom").datepicker("option", "maxdate", dt); } }); $('.submit-here').click(function() { // var link = day_1+month_1+year; var date1 = $("#txtfrom").datepicker('getdate'), day_1 = date1.getdate(), month_1 = date1.getmonth() + 1, year_1 = date1.getfullyear(); var date2 = $("#txtto").datepicker('getdate'), day_2 = date2.getdate(), month_2 = date2.getmonth() + 1, year_2 = date2.getfullyear(); var = $('#selection :selected').text(); var people = $('#people :selected').text(); console.log('www.lekkeslaap.co.za/akkommodasie-in/'+where+'?q='+where+'&start='+day_1+'+'+month_1+'+'+year_1+'&end='+day_2+'+'+month_2+'+'+year_2+'&pax='+people); $("a#atributo").attr("href", "www.lekkeslaap.co.za/akkommodasie-in/"+where+"?q="+where+"&start="+day_1+"+"+month_1+"+"+year_1+'&end='+day_2+'+'+month_2+'+'+year_2+'&pax='+people); }); });
Comments
Post a Comment