Javascript passes more than one parameter

0

I have this code:

1 == a.redirect ? window.location = rootUrl + "/options/?welcome=true" : ($("#message").css("display", "block"), $("#message").html(a.message)), $("#signinButton").attr("value", "Entrar")

I would like to pass three more parameters, but it does not work, how do I do it?

1 == a.redirect, a.firstparam, a.secondparam ? window.location = rootUrl + "/options/?welcome=true" : ($("#message").css("display", "block"), $("#message").html(a.message)), $("#signinButton").attr("value", "Entrar")

I've tried it too:

1 == a.redirect ? window.location = rootUrl + "/options/?welcome=true" : ($("#message").css("display", "block"), $("#message").html(a.message)), $("#signinButton").attr("value", "Entrar")

First

2 == a.firstparam ? window.location = rootUrl + "/options/?welcome=true" : ($("#message").css("display", "block"), $("#message").html(a.message)), $("#signinButton").attr("value", "Entrar")

Second

3 == a.secondparam ? window.location = rootUrl + "/options/?welcome=true" : ($("#message").css("display", "block"), $("#message").html(a.message)), $("#signinButton").attr("value", "Entrar")

But none works. How do you do?

    
asked by anonymous 01.07.2017 / 10:14

1 answer

2

I think you want it to be 1 == (a.redirect && a.firstparam && a.secondparam) ? [...], being complete as follows:

1 == (a.redirect && a.firstparam && a.secondparam) ? window.location = rootUrl + "/options/?welcome=true" : ($("#message").css("display", "block"), $("#message").html(a.message)), $("#signinButton").attr("value", "Entrar")

Not the rest of the code I have not tested, but I hope this helps!

    
01.07.2017 / 10:32