Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
And now it does nothing
Message
De
03/04/2013 13:10:55
 
 
À
03/04/2013 12:41:36
Information générale
Forum:
Javascript
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01569918
Message ID:
01569932
Vues:
34
>>And the good news is, it doesn't error/log when "select Topic" is selected.
>>...the bad news....it doesn't do anything at all.
>>
>>Now, I've never claimed to be a Java-master and shan't be attempting to claim it for QUITE a while, but it seems to me that the if stmt is saying:
>>If selectedIndex > 0
>> display the information
>>else
>> throw up idiot box
>>
>>Is anyone seeing anything other than that?
>
>If this is Javascript, If should be lowercase and the condition within parentheses I believe. If there is no error, make sure the browser is set to show the Javascript errors.

Yep. The 'If' is a problem. This should work:
function SCDropDown(topiclist)
        {
            if (topiclist.selectedIndex > 0)
            {
                location.href='go.hcn?hcn2~recipe~'+topiclist.options[topiclist.selectedIndex].value;
            }
        else {
                alert('Please select a recipe');
            }
        }
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform