whats wrong with this JS
firebug is complaining its开发者_运维技巧 there is a syntax error
if (document.getElementById("fromAddress").value == "") ||
(document.getElementById("fromAddress").value == "Enter Address, City, Directions") {
You are missing the parenthesis, that being said you are better off writing it like this.
var from = document.getElementById("fromAddress").value;
if (from === "" || from === "Enter Address, City, Directions") {
You need to wrap the entire conditional statement in parans:
if ( (blah) || (blah) )
^ ^
{
// as you were
}
You have mis-match of parenthesis, try this:
if ((document.getElementById("fromAddress").value == "") ||
(document.getElementById("fromAddress").value == "Enter Address, City, Directions")){...}
Corrected form: (removed 2 parentheses)
if (document.getElementById("fromAddress").value == "" || document.getElementById("fromAddress").value == "Enter Address, City, Directions") {
精彩评论