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...

argh
  • 933
  • 13
  • 37

1 Answers1

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?!

argh
  • 933
  • 13
  • 37
  • 1
    Script tags should never be used in the self-closing way. You can find more info on why here: http://stackoverflow.com/questions/69913/why-dont-self-closing-script-tags-work – Peter Mar 13 '13 at 09:58