Answer the question
In order to leave comments, you need to log in
Javascript on mobile?
Hey! There is a link zolo-cms.ru.host1616859.serv16.hostland.pro/servic...
on desktops, after switching to it, everything works as it should - data is taken from the address bar using javascript and the domain required by the user is automatically searched. But as soon as you log in using your mobile, absolutely nothing happens (The code is in the file js/get_domains.js .. Here,
in fact, it is. Her job is that she takes data from the address bar to select a domain, loads the site name into the input, checks the domain zone and presses the Submit button (that's how detailed it is) Why doesn't it work on a mobile phone?
function getDataLink() {
var searchStr = document.location.search;
if(searchStr) {
searchStr = searchStr.replace('?','').split('&').reduce(
function(p,e){
var a = e.split('=');
p[ decodeURIComponent(a[0])] = decodeURIComponent(a[1]);
return p;
},
{}
);
$("#domen").val(searchStr.name);
var zoneCheckbox = '#' +searchStr.zone;
$(zoneCheckbox).click();
$('.submit_check').click();
return searchStr;
} else {
return;
}
}
Answer the question
In order to leave comments, you need to log in
Three very significant circumstances are missing:
1) The platform on which it does not work.
2) The browser in which you check.
3) Versions of jquery.
First you need to find out if item 3 is supported on item 2 and 1.
Next, try not through a click, but through the form submit.
And more... who taught you to put checkboxes through the click method? To do this, you need to use prop.
p.s.
for some reason it seems that decodeURIComponent may not be supported by mobile platforms.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question