Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hide won't
Message
From
11/03/2014 03:25:06
 
General information
Forum:
Javascript
Category:
JQueryUI
Title:
Miscellaneous
Thread ID:
01596038
Message ID:
01596087
Views:
41
There's a potential error if you place the opening brace on an empty line. Consider:
return
{ x:1};
Javascript engines will often place an implied semi-colon after return

>That is ridiculous about JSint. A code block's opening { being placed at the end of a line is a very common formatting style.
>
>>And yes, I'm getting the value I'm expecting - and it's NOT equal to 'custom', so it should be hiding the CustomCodes DIV section.
>>
>>But it's not.
>>
>>Notepad++ will also do that for you
>>
>>Also, I tried putting them on a separate line, but whenever I attempt to run the code to JSint it screams about the opening { not being on the same line as the code.
>>
>>
>>>Try alert($('#RwrdCode').val()); to verify you're getting the value you expect.
>>>
>>>As for the {}, I suggest you put them on a new line to help see where they line up. If you are using Visual Studio, you can place the cursor after one, and it will highlight the matching begin or end bracket.
>>>
>>>>ok...got past the '=' vs '==' thing - also have fought through the stupid mis-matched '{' and '(' things ('splain to me how that's so much better than a simple 'begin' and 'end' if you insist on having to tell the compiler where a command starts and finishes)
>>>>
>>>>Now...for something completely different.... Hide won't
>>>>
>>>>
>>>>$(function RewardOnChng(control) {                       
>>>>alert("In RewardOnChng function"); 
>>>> if ($('#RwrdCode').val() == 'custom'){
>>>>        $('#CustomCodes').fadeIn();}
>>>>      else{
>>>>        $('#CustomCodes').hide();}
>>>>
>>>>
>>>>This is on a dropdown list with a label and textbox for free entry on a certain value.
>>>>
>>>>"CustomCodes" is the [broket}DIV[/broket] definition for the label/textbox
>>>>
>>>>I know that it's going into the function, since the alert box shows....and that's all that happens, as far as I can tell.
>>>>
>>>>Why won't it hide?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform