www.webdeveloper.com
Results 1 to 2 of 2

Thread: firebug: lists.create is not a function

  1. #1
    Join Date
    Apr 2010
    Posts
    26

    firebug: lists.create is not a function

    Firebug barks "lists.create is not a function" when I click on the link below:
    Code:
    	var lists = function(){
    		var create = function(component){
    			var component = component.href.substring(component.href.lastIndexOf('#') + 1); //sites
    			return component;
    		}
    		var setDefaults = function(component){
    			var parameter = {};
    			switch(component){
    				case "sites":
    					parameter = {
    						order: 'site_num',
    						per_page: '20',
    						url: '/sites'
    					}
    			}
    			return parameter;
    		}
    		var criteria = {
    			drop_filter: {
    				check: function(value){
    					if(value)
    						return
    				},
    				msg: "Loading..."
    			},
    			search_filter: {
    				check: function(value){
    					if(value)
    						return
    				},
    				msg: "Loading..."
    			}
    			
    		}
    		return {
    			//not currently used
    			addQuery: function(name, query){queryArr[name] = query;},
    			extra: function(){}
    		}
    	}
    	
    	
    	
    	
    	$('#dashboard a').click(function(){
    		var currentComponent = lists.create(this);
    		var custom = lists.setDefaults(currentComponent);
    		initializeTable(custom);
    	});
    	
    	
    	var initializeTable = function(custom){
    		var defaults = {};
    		var query_string = $.extend(defaults, custom);
    		alert(query_string);
    		/*
    		$.each(query_string, function(key,value){
    			
    		})
    		
    		var queryArr = [];
    		*/
    		
    	}
    Thanks for response.

  2. #2
    Join Date
    Apr 2010
    Posts
    26
    I figured it out. You have to convert the functions into closures using return keyword and then call the function immediately ()() before you try to use it as a private function.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles