Thanks, Kyle... Rick
> -----Original Message----- > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > Behalf Of KyleFarris > Sent: Friday, December 12, 2008 9:21 AM > To: jQuery (English) > Subject: [jQuery] Re: What's the correct way to write this code? > > > Umm... also make sure you are using the double equals sign when doing > comparisons... Like: > > if (response.login = "Login Successful") { > top.location.href = "site_manager.cfm"; > } else { > $('#contentdiv').empty().fadeIn(1000).append(response.login); > } > > On Dec 12, 9:07 am, MorningZ <morni...@gmail.com> wrote: > > Wow, this is just basic JavaScript syntax > > > > if (conditon) { > > > > } > > else { > > } > > > > you have > > > > if (response.login = "Login Successful"); > > > > drop the semi-colon after both your (conditions) > > > > On Dec 12, 8:58 am, "Rick Faircloth" <r...@whitestonemedia.com> wrote: > > > > > How should this be written? I can't figure it out. > > > I keep getting "syntax error: else" > > > > > success: function(response){ > > > > > if (response.login = "Login Successful"); > > > {top.location.href = "site_manager.cfm"} > > > > > else > > > > > if (response.login == "Login Unsuccessful"); > > > {$('#contentdiv').empty().fadeIn(1000).append(response.login)}; > > > > > }