-1
I have this code, I’d like to know if it’s correct the way it is?
Javascript code:
function texto(){
if(SONome == 'Windows 10 x32'){
window.location.href =
'http://teccitystore.com.br/downloads/eCHEF_Install.exe';
var a_ = '<a class="wsite-button wsite-button-small wsite-button-
highlight"></a>';
document.html(a);
} else if(SONome == 'Windows 10 x64'){
window.location.href="http://teccitystore.com.br/downloads/eCHEF_Install_x64.exe
";
var a_ = '<a class="wsite-button wsite-button-small wsite-button-
highlight"></a>';
document.html(a);
}
Html code:
<a class="wsite-button-inner" ng-disabled="boxes.email" id="Win32"
name="Win32" onclick="texto()">
Windows x32
</a>
Wouldn’t it be better to give the person the option to choose whether to install the 32bit or 64bit? This is because there are many situations where even most operating systems being 64bit and yet the user prefer to use 32bit (x86).
– Guilherme Nascimento
I agree with your point of view @Guilhermenascimento but I have a superior who asked as chosen above, I can not go against understand..
– Alis
Yes I understand Alis, I still think that for almost everything it is possible to present arguments and even examples of large sites that do it, however returning to its problem, could tell me what function this is
document.html()
? It was you who created it, it is not standard I believe, where exactly you intend to inject the link<a class="wsite-button wsite-button-small wsite-button-
highlight"></a>
on the page? PS: it was not I who denied the question.– Guilherme Nascimento
in this part had asked help to a friend, but it did not solve much, look, on the page just when it is loaded is informed by another function like your Windows, and it was for this function ai take the value of the windows of the person who is in "Sonome", and divide between the two possible cases. If it is Wx64 would call the download file,and the button class to leave it blue. It should happen more or less in both cases.I will inject in the html code, in the part I posted, this was expected when calling the function that contained it
– Alis
Then the only need is to start the download automatically by clicking on
<a class="wsite-button-inner"
, correct? Then what is the use of<a class="wsite-button wsite-button-small wsite-button- highlight">
and<a class="wsite-button wsite-button-small wsite-button-
highlight"></a>
? Because if they have no use I will suggest some changes to your code. Please explain exactly what you want your code to do.– Guilherme Nascimento
Basically: If the variable is a case, it is to start the download. Main objective
– Alis