ceth
ceth

Reputation: 45285

$(document).ready(function() - don't work

I am using Rails & jQuery.

Here is HTML which I get:

<head>
  <title>Some</title>
  <script src="/javascripts/jquery.js?1305699774" type="text/javascript"></script>

 <script type="text/javascript">
   alert("2");
   $(document).ready(function() {
      alert("1");
      ....

When I am refreshing the window I get only one alert message ("2"). Why I didn't get second alert message?

enter image description here

Upvotes: 1

Views: 935

Answers (1)

Maxim Krizhanovsky
Maxim Krizhanovsky

Reputation: 26699

You have included prototype, which also defines $. So use jQuery() instead of $ and run jQuery in .noConflict() mode

Upvotes: 5

Related Questions