Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

TypeError: elem is undefined

$
0
0
Hello,

I just started with JMVC and after some coding my web-console of Firefox throws this error. But I dont really get where it comes from. When I click on the error I get referred to of jquery.js:

  1. // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { if ( elem.nodeName ) { var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; if ( match ) { return !(match === true || elem.getAttribute("classid") !== match); } } return true; }
I have a link on my site called "Login", when I click on it the follow code gets executed:

  1. click: function() {
  2.                 var dialog = new Widgets.Dialog("//prizeplay/users/login/views/login.ejs", { title: "Login" });
  3.                 console.log(dialog);
  4.                 return false;
  5.             }
The function itself works fine, but when the "new Widgets.Dialog" gets executed, it throws the error mentioned in the title. I posted also the "Widgets.Dialog" code here.
  1. steal(
  2.     'jquery/controller',
  3.     'jquery/view/ejs'
  4. )
  5. .then('./views/init.ejs', function($) {
  6.     /**
  7.      * @class Widgets.Dialog
  8.      */
  9.     $.Controller('Widgets.Dialog',
  10.         /** @Static */
  11.         {
  12.             defaults: {}
  13.         },
  14.         /** @Prototype */
  15.         {
  16.             settings: {
  17.                 title: "undefined",
  18.                 modal: true,
  19.                 appendTo: "body"
  20.             },
  21.            
  22.             init: function(tmpl, settings) {
  23.                 this.setUp(settings);
  24.                 this.show(tmpl);
  25.             },
  26.            
  27.             show: function(tmpl) {
  28.                 $('<div></div>').html(tmpl, this.settings);
  29.             },
  30.            
  31.             setUp: function(settings) {
  32.                 for (var attr in settings) {
  33.                     this.settings[attr] = settings[attr];
  34.                 }
  35.             }
  36.         }
  37.     );
  38. });

Can you help me?


Viewing all articles
Browse latest Browse all 3491

Trending Articles