4

wanted to include jquery in masterpage, but as soon as I did that - my login page stopped working... in chrome console I'm getting:

uncaught TypeError: Cannot read property 'onsubmit' of null

from stack I can see that it is here:

Sys.WebForms.PageRequestManager._initialize('ctl00$ScriptManager1', document.getElementById('aspnetForm'));

in firefox:

this._form is null
this._onsubmit = this._form.onsubmit; 

and that error is in ScriptResource.axd?=...

and this causes that I can't just click on the Login button - it does nothing... on the other hand - everything works in Opera... even better - if I am to remove:

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.5.min.js" type="text/javascript" />      

then everything works fine (tried also other versions of jquery)... now the best is that other pages - that also have buttons and events, work... I've even changed the login page not to use Login control... and it still doesn't work... I'm really confused right now...

1
  • please provide here the order of loading your scripts Commented Feb 1, 2011 at 18:38

1 Answer 1

11

My colleague found a solution by an accident... if you change:

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.5.min.js" type="text/javascript" /> 

to

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.5.min.js" type="text/javascript"></script>

it magically starts to work... now... this should be xhtml... can anyone explain to me WHY there is a difference here?!

Sign up to request clarification or add additional context in comments.

1 Comment

Script tags should never be used in the self-closing way. You can find more info on why here: stackoverflow.com/questions/69913/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.