Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

help with if else statement

New Here ,
Mar 09, 2021 Mar 09, 2021

I am trying to get this to work but im having problems, can anyone help me please, I have it writing the answer to mychoice, but i cant get it to go to a url if the answer is "english13i34gb128gbblack" , this is what I have on the frame action at the end of the timeline:

 

var _this = this;

_this.stop();

mychoice = language + size + cpu + ram + ssd + colour


document.write("Your choices are: " + mychoice);


if(mychoice = "english13i34gb128gbblack") {
window.open('https://www.success.com/', '_blank');
} else {
window.open('http://nomatches.com/', '_blank');
}

 

TOPICS
Code , Timeline
195
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 09, 2021 Mar 09, 2021
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2021 Mar 09, 2021
LATEST

thanks, that is correct, i just figured it out before you posted, for anyone looking at this, here is my corrected code:

 

var _this = this;

_this.stop();

mychoice = language + size + cpu + ram + ssd + colour


document.write("Your choices are: " + mychoice);


if(mychoice == "english13i34gb128gbblack") {
window.open('https://success.com', '_blank');
} else {
_this.stop();
}

 

if(mychoice == "french15i732gb2tsandstone") {
window.open('https://www.french.com/', '_blank');
} else {
_this.stop();
}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines