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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:30:36+00:00 2026-06-18T15:30:36+00:00

I have a simple wishlist script written in Javascript that adds an item into

  • 0

I have a simple wishlist script written in Javascript that adds an item into a wishlist. The script adds the item successfully into the user’s list but I can’t seem to display a success message.

I’m using the code below to try and display the success message. The script initially worked then just suddenly stopped working.

function AddItem(ToDoItem) {
    if ((ToDoItem != null) && (ToDoItem != "undefined" )) {
        NumToDoItems++;
        SetCookie('PT_ToDoItem'+NumToDoItems, ToDoItem, exp);
        SetCookie('PT_NumToDoList',NumToDoItems, exp);
        $(window).humanMsg('Added '+ToDoItem+' to Wishlist');
    }
}

Can you please have a look at the code and provide me some advice?

More info:

My html:

<div class="add-to-wishlist">
<a href="javascript:AddItem('<?php print htmlentities($title, ENT_QUOTES); ?>')">
<img class="add-to-wishlist" src="/images/add-to-wishlist-button.gif" border="0" /></a>
</div>

Here is the humanMsg. plugin for jQuery

(function($, window){

$.fn.humanMsg = function( message, options ) {
    return this.each(function(){
        var container = this == window || this == document ? document.body : this;
        !$.data(container, 'humanMsg') && $.data(container, 'humanMsg', new     $.humanMsg (container, message, options) );
    });
};

$.humanMsg = function( container, message, options ) {
    if (typeof message == 'object') {
    options = message;
    message = null;
}

var s = $.extend({}, $.humanMsg.defaults, options);

var $m,
    sizeContainer = container == document.body ? window : container;

$m = $('<div class="humanized-message '+s.addClass+'"/>')
.html(message || s.message)
.click(remove)
.appendTo(container);

$m.css({
    display: 'none',
    visibility: 'visible',
    top: ($(sizeContainer).height()-$m.innerHeight())/2,
    left: ($(sizeContainer).width()-$m.innerWidth())/2
})
.fadeIn(s.speed);

s.autoHide && setTimeout(remove, s.autoHide);   

function remove() {
    $m.fadeOut(s.speed, function(){
        $m.remove();
        $.removeData(container, 'humanMsg');
    });
}

};

$.humanMsg.defaults = {
message: 'no message was set',
autoHide: 3000,
addClass: '',
speed: 300
};

})(jQuery, this);

Looking into the error console I have this:

Uncaught TypeError: Property '$' of object [object Window] is not a function 
(anonymous function)
closing script tag manually 
  • 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-18T15:30:37+00:00Added an answer on June 18, 2026 at 3:30 pm

    The error indicates that jQuery hasn’t been included in the script.

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

Sidebar

Related Questions

I have simple php validation form that is halfway working. If you leave the
I have simple JavaScript snippet: var obrazek = [{nazwa: "Sniadanie", wiek: 100, autor: "Alicja"},{nazwa:
I have simple script with EventMachine, Fibers and faye require faye require em-synchrony require
I have simple win service, that executes few tasks periodically. How should I pass
I have simple perl script as below: #!/usr/bin/perl use strict; use Data::Dumper; my %x;
I have simple mailer which sends user weekly digest and rake task which sends
I' have simple question about JAXB. Here is the sample code: //setter that has
I have simple list: <ul id=tabs_nav> <li id=t_00>data</li> <li id=t_01>data</li> <li id=t_02>data</li> <li id=t_03>data</li>
I have simple gallery using unordered list. <h1>Projects</h1> <hr> <!-- Projects gallery as unordered
I have simple question to you, I have class Product that have fields like

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.