Link to home
Start Free TrialLog in
Avatar of lapucca
lapucca

asked on

Why my jquery code not doing a thing and no errors?

Hi, I'm using asp.net and C# and jQuery.  Please see the attached Master and Content page.  I have ref to jquery in Masterpage and then the jQuery script is in the content page head section.  When I click on the listbox there supposed to be label and textbox that appear but nothing happens.  Looking at the Firebug and still nothing happen.  I checked the script in Firebug and put in a couple of breakpoints and those breaks were never triggered.  I then added a link to hide the email label in Content page and that didn't happen either.  Can someone please help with this.  I've been stocked in this problem for days.
MasterPage.master
AddNewPatient.aspx
AddNewPatient.aspx
Avatar of Greg Alexander
Greg Alexander
Flag of United States of America image

Just did a quick look, try moving the inclusion of jquery itself to the top of the page... not an asp programmer but that seems like it would help..
Avatar of lapucca
lapucca

ASKER

Top of which page?  I added the ref to jQuery to the content page head section to test and see if that would make it work but it didn't.  In the Master page there is already ref to jQuery library so it is at the top.  I don't think there is a problem to the jQuery ref because I don't get '$' not define error and also, the superfish jQuery plugin menu works with no problem.  Thank you.
It would appear you are trying to set a function to (document).ready twice (source line 14 and 29). My guess would be if it's doing the snapfish script ok, it's ignoring the 2nd attempt to set the function.

hope that helps
Avatar of lapucca

ASKER

I removed the script block from the Content page and put a test jQuery code to hide a label after the superfish function in the Master Page's script are, but that didn't work either.  I even used the ClientId foudn in the Page Source view for ref that label.  
<script type="text/javascript" language="javascript">      
            $(document).ready(function() {
            $('ul.sf-menu').superfish();

            $('ctl00_ContentPlaceHolder1_lbEmail').hide();   
            }); 
    </script>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of gavsmith
gavsmith
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lapucca

ASKER

You're a lifesaver.  I've been stocked with this for couple of weeks!  Once I added the # then most of my script is working again.  thank you.