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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:52:46+00:00 2026-06-01T10:52:46+00:00

This didn’t happen until I have added jQuery. function mfunc() {} mfunc.prototype.create = function(value)

  • 0

This didn’t happen until I have added jQuery.

function mfunc() {}
mfunc.prototype.create = function(value) { 
alert("hi");
}

Script before the closing body tag:

$(document).ready(function(){
 var mfunc = new mfunc();
    alert("hi");
    alert(mfunc.create("hello"));

 });

I get the following error in firebug:

mfunc.create is not a function

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-01T10:52:48+00:00Added an answer on June 1, 2026 at 10:52 am

    You are shadowing your prototype function! Your original function is called mfunc, but then you are using that same variable name to refer to a new instance. Use a different variable name:

    $(document).ready(function(){
        var mobj = new mfunc();
        alert("hi");
        alert(mobj.create("hello"));
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read at Scottgu blog about using OutputCache for a function but this didn't
I have this remap: public function _remap($method, $params = array()) { if (method_exists($this, $method))
I have a function like this: function doSomething() { // do something with select
This didn't work: Setting the umask of the Apache user Arch doesn't have a
I have a sp something like this create proc disp as begin select *
I am trying this code: <script type=text/javascript> $(document).ready(function() { $('.edit').editable('http://www.example.com/save.php', { indicator : 'Saving...',
How can I update multiple values in MySQL? This didn't work: UPDATE test SET
This code didn't works as expected. I want to select all the posts that
This thread didn't helped me. If I use $class_vars = get_class_vars(get_class($this)); foreach ($class_vars as
Hopefully no one has asked this question - didn't see it, but I apologize

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.