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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:04:53+00:00 2026-06-13T07:04:53+00:00

I got the following js code which is erroing in the console and i’m

  • 0

I got the following js code which is erroing in the console and i’m not too sure of what i’m doing wrong. Basically i’m trying to get a list of fields so i can do some calcs on.

var LabourItems = {
    rate: null,
    hours: null,
    total: null,
    init: function(object) {
        var rate = $(object).children('.rate').first();
        var hours =$(object).children('.hours').first();
        total = rate * hours;
        updateTotal(object,total);
    },
    updateTotal: function(object,  total) {
        $(object).children('.total').first().attr('value', total)
    }
}

//reactTochange for those inputs that you want to observe
$('.hours').live(function() {
    var labourItems;

    jQuery.each($('.labouritems'), function(key,value){
        labourItems.push(LabourItems.init(value));
    });

});

Console Error:

Uncaught TypeError: Object function () {
    var labourItems;

   jQuery.each($('.labouritems'), function(key,value){
       labourItems.push(LabourItems.init(value));
   });

} has no method 'replace'
  • 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-13T07:04:53+00:00Added an answer on June 13, 2026 at 7:04 am

    live needs an event type eg. click.

    it’s treating the function as the event string and it’s getting hella confused.

    $('.hours').live(function() { /*... your code ...*/})    // wrong
    

    needs to be:

    $('.hours').live("click", function() { /*... your code ...*/})    // works
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got the following code in my Services project, which is trying to grab
I am trying to run the following code (which I got from here ).
I've got the following code which basically when the value of the select is
Hi all i've got the following code which will go off and get all
Hi i got the following code which i use to get some integers from
All, I've got the following code to which is basically a function that loads
I've got the following JAXB unmarshalling code which I'm trying to generalize. Here's what
Ive got the following code which I hacked together from website examples. It works
i've got the following code which runs a bat file. the bat file then
I got the following code, which converts a char[] to a byte[]: char[] cPwd

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.