Ask questions and get good answers on mb.jQuery.components

I would like to access the variables declared within extend as shown:

$.extend( $.fn.pippo.prototype , { messages: [], element: null });

How do I access to the "messages" variable from an external function?

Is it possible?

asked Oct 28 '09 at 23:08

Federico%20Soldani's gravatar image

Federico Soldani
173128


You shoul declare the pippo class before and add the def object that you want to extend.

  $.fn.pippo=function(){};
  $.fn.pippo.def={};
  $.extend( $.fn.pippo.def, { messages: ["a","b","c"], element: null });

alert($.fn.pippo.def.messages);

answered Oct 29 '09 at 09:49

Matteo%20Bicocchi's gravatar image

Matteo Bicocchi ♦♦
1776129

edited Oct 29 '09 at 12:46

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×1
×1

Asked: Oct 28 '09 at 23:08

Seen: 156 times

Last updated: Oct 29 '09 at 12:46

Related questions

jQuery main site - Matteo Bicocchi