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 6812219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:25:22+00:00 2026-05-26T20:25:22+00:00

I am attemtping to solve an issue I am having and decided to try

  • 0

I am attemtping to solve an issue I am having and decided to try the event handler for the .load() jQuery function. I am unsure what I did wrong. The example on the jQuery page is:

$('#book').load(function() {
 // Handler for .load() called.
});

my script was:

var $j = jQuery.noConflict();
$j('#gallery-nav-instruct').load(function() {
  if(!$j.cookie('gallerycookie')){
    $j.colorbox({ inline:true, href:"#gallery-nav-instruct"});
    $j.cookie("gallerycookie", 1, {expires: 30, path: '/'});
  }
}); 

Why did my script not work?

Here is the HTML related to that script:

<div style="display:none">
  <div id="gallery-nav-instruct">
    <h2>Gallery Navigation Instructions - Step 1</h2>
    <h2 style="text-align:right">
      <a style="text-align:right;" class="inline cw" href="#gallery-enlarge-instruct">Step 2</a>
    </h2>
    <p>&nbsp;</p>
    <p class="white">
      <img src="/Images/Pages/gallery-navigation.jpg" width="890" height="450" alt="Gallery Navigation Instructions" />
    </p>
  </div>
</div>
  • 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-05-26T20:25:22+00:00Added an answer on May 26, 2026 at 8:25 pm

    Do you have a way of confirming that the div isn’t already loaded by the time the event is bound? In other words, it could be a timing issue. The load completes, the event is bound, but the event is never fired because the load is already complete.

    I would be interested in knowing the problem you’re trying to solve; rather than trouble-shooting the .load() itself (although that might end up being the tool after all!) it’s best to allow room for lateral thinking. For example, I don’t see why you couldn’t do your cookie check and colorbox initialization on document ready. It may be that the image isn’t loaded yet, but I don’t think that would break user experience.

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

Sidebar

Related Questions

I am having some real difficulty attempting to solve a JQuery $.each() iteration This
Hey, I'm having an issue seperating packets using a custom binary protocol. Currently the
I'm attempting to solve the below exam question but I'm having difficulties with it.
I'm attempting to solve the Project Euler Problem 8 with C++, and the problem
I have sort of a tricky problem I'm attempting to solve. First of all,
When attemptiing to solve the below assignment : Using the Arithmetic operators ( +,-,*,/)
Attempting to use the data series from this example no longer passes the JSONLint
Attempting to use XStream's JavaBeanConverter and running into an issue. Most likely I'm missng
I'm attempting to solve a set of equations of the form Ax = 0.
I'm attempting to solve the Code Golf: Build Me an Arc problem. My solution's

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.