Javascript pass more than one parameter

Asked

Viewed 24 times

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 to 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 tried so 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")

According to

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 does?

1 answer

1


I think you want this 1 == (a.redirect && a.firstparam && a.secondparam) ? [...], being completed 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 haven’t tested, but I hope this helps!

  • worked but the redirect stopped working...

  • Well back work I don’t know what happens... but the Cookies created in my Json does not go along with redirect.

  • It seems to me that this is another question. Send complete code so that it can be analyzed and read better. Since you’re so confused, you can’t tell what your intention is.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.