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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:31:50+00:00 2026-06-01T04:31:50+00:00

I’m pretty new to jQuery, and I am converting a page from regular javascript

  • 0

I’m pretty new to jQuery, and I am converting a page from “regular” javascript to jQuery on a coldfusion page. The page is driven off a stored procedure, which, based on it’s result sets, changes the page and number of input fields. On my page, the input tags look like this.

<cfinput name="#trim(characteristic_id)#_fund" id="#trim(characteristic_id)#_fund" value="#fund#" size="11" onFocus="getCurrentValue(this)" onblur="checkChange(this,'c')">
<cfinput name="#trim(characteristic_id)#_benchmark" id="#trim(characteristic_id)#_benchmark" value="#benchmark#" size="11" onFocus="getCurrentValue(this)" onblur="checkChange(this,'c')">

The onFocus event just saves the current value, and the onBlur event checks to see if the value has changed, and if it has save it in a array for further processing.

Personally, I feel like jQuery is suited very well for this kind of processing, and it is on of the main reason I am trying it.

To my issue. Right now I am replacing the onFocus event handler with:

$("input").focus(function(){
    alert($(this).val());
});

simple, but when I try i, nothing happens, no javascript errors, nothing. Nothing happens at all. So, all of the other jQuery code that I have written, I have used $(document).ready..., and when I used that, it worked fine. From what I’ve read, the UI is rendered before the DOM is ready, but to compound that issue the coldfusion is running prior to everything else.

My question is this; Do I have to put all of my jQuery code inside the $(document).ready... function or is there another way around it.

Thanks in advance.

  • 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-01T04:31:52+00:00Added an answer on June 1, 2026 at 4:31 am

    You do need to put your code in $(document).ready() or $(window).load() if you want to attach handlers to DOM objects. That being said, you can call code in a script block that loads after the element you want to manipulate and that should work, too. However, it is good practice to use the ready/load handlers.

    If you don’t wait for the DOM to load, the elements don’t exist yet.

    You do not have to stuff all of your code in one ready block if you don’t want to. You can have multiple $(document).ready() blocks. Each will simply be called in succession once the document loads.

    $(window).load(), by the way, waits for the elements themselves to load, such as images.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I am reading a book about Javascript and jQuery and using one of the
I have a text area in my form which accepts all possible characters from
I have a bunch of posts stored in text files formatted in yaml/textile (from
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has

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.