开发者

Javascript - URL based on Drop Down Selections - If all dropdowns variables are blank, then goto a specific URL

开发者 https://www.devze.com 2023-03-11 11:25 出处:网络
This is my code so far: http://jsfiddle.net/zY3xx/ I have a blank option in all 3 dropdowns, and I want to modify the existing Javascript so that it goes to a specific URL if all 3 dropdowns have the

This is my code so far: http://jsfiddle.net/zY3xx/

I have a blank option in all 3 dropdowns, and I want to modify the existing Javascript so that it goes to a specific URL if all 3 dropdowns have the blank option selected. The Variable is literally left empty, so it should be something along the lines of:

if开发者_Go百科 newURL = "" then goto "http://mycustomurl.com"

I'm just not sure how to implement that option in Javascript.

Does anyone know how?


Try this:

    if (newUrl.length === 0) {
        newUrl = 'http://google.com';
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消