开发者

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

开发者 https://www.devze.com 2023-04-09 23:31 出处:网络
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>

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?

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消