Link to home
Start Free TrialLog in
Avatar of bamapie
bamapie

asked on

jQuery / "'Sys' is undefined"

Hi.  I am trying to use some way-cool jQuery alerts in my ASP.NET website.

One of the first alert() calls that I'm going to want to eliminate is actually called from my Page_Render() event on the server side.  It's a browser warning about IE.

After referencing this jQuery tool's js/css files and trying my app out in IE (so that it executes the RegisterClientScript() call that adds the new JS), I get this

'Sys' is undefined

error.  It happens in this part of the page's execution:

      $(document).ready(function() {
         Sys.Application.add_load(function() { Page_onLoad(); });
      });

Does not happen in Firefox...but then, remember, it's the server-side script registration that's bombing out with the new jQuery alert() tool.  

This same server-side code does not fail with the old conventional alert() call.

Now, here's the deal.  I can use Google, and there are tons and tons of "here's how to fix this problem" sites on the net that deal with this specific error.

I CAN comb through those, and I AM combing through those now.  But I'm posting this question in an attempt to find someone who has dealt with this particular error and has specific knowledge or experience with it to help me out.

I repeat:  I can use Google, and AM using Google, so please don't just send me links.  I've tried tons and tons of "fixes", and am STILL trying them.  None have worked.  Please--I need someone with knowledge/experience specific to this problem.

Thank you!  Happy to post web.config markup, or whatever, if that helps.
ASKER CERTIFIED SOLUTION
Avatar of bamapie
bamapie

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 Todd Gerbert
I haven't done much reading on jQuery, but from what I understand your solution seems to be the "correct" way, not a workaround.  Otherwise, your JavaScript runs before the jQuery libraries have been loaded - hence the Sys is not defined error.

You can accept your own response as the correct answer to this question.
SOLUTION
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 bamapie
bamapie

ASKER

My workaround looks to be the conventional way of doing this.  Not clear on why this suddenly became a surprise on this jquery.alerts library.