Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8773131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:13:01+00:00 2026-06-13T18:13:01+00:00

I’m working with Rails 3.2.8 and am running jQuery v1.8.2. The following works: $(window).load(function(){

  • 0

I’m working with Rails 3.2.8 and am running jQuery v1.8.2.

The following works:

$(window).load(function(){
alert('window load is working');
});

But this does not work:

$(document).ready(function() {
alert('document ready is working');
});      

In fact, whenever I switch $(document).ready() with $(window).load() for any and all jQuery functions I am testing, they are fired. These include accordions, draggable elements…

Here is my application.html.erb file:

<!DOCTYPE html>
<html>
<head>
<title><%= full_title(yield(:title)) %></title>
<%= stylesheet_link_tag    "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body background="<%= image_path(random_bg) %>">
<%= render 'layouts/header' %>

<div id="container">

<% flash.each do |key, value| %>
      <div class="alert alert-<%= key %>"><%= value %></div>
<% end %>

<%= yield %>
</div>
 <%= render 'layouts/footer' %>
</body>
</html>

The resulting html…

<html>
<head>
<title>Derp</title>
*bunch of css files*
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery-ui.js?body=1" type="text/javascript"></script>
<script src="/assets/collections.js?body=1" type="text/javascript"></script>
<script src="/assets/global.js?body=1" type="text/javascript"></script>
<script src="/assets/derp.js?body=1" type="text/javascript"></script>
<script src="/assets/sessions.js?body=1" type="text/javascript"></script>
<script src="/assets/static_pages.js?body=1" type="text/javascript"></script>
<script src="/assets/test.js?body=1" type="text/javascript"></script>
<script src="/assets/users.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>
....

I have also gone throw stackoverflow, searched the web neurotically, and tried all the solutions I could find:

  • I have tried disabling local jQuery and using Google to host jQuery
  • I have tried playing around with the placement of javascript_include_tag (moving it above stylesheets, moving it before )
  • I tried including $(document).ready() inside $(window).load()

But $(document).ready() still does not fire… There are no problems in console (checked on Chrome, Safari, Firefox)

A similar question was asked here, but he never received an answer to his main question.

Why does jQuery only work when I replace $(document).ready() with $(window).load()?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:13:02+00:00Added an answer on June 13, 2026 at 6:13 pm

    Sorry guys, I solved it by removing some crappy javascript I wrote. It was supposed to be a code that would display labels in browsers that don’t support placeholders. Somehow as soon as I deleted the file everything resumed working like normal… Weird how I always spend hours trying to fix a problem and seem to solve them moments after asking a question here!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT
I want to construct a data frame in an Rcpp function, but when I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.