Uncaught TypeError: object is not a function. Clone html and Back button [closed]

4

I'm having a system problem where I need to make a back button and thought of a function to clone using and a function for the back button.

But the problem is that when I log into the system I go to a menu and when I click on an option it loads a sub-menu in the same grid , that's where all user interaction occurs, when I click on the back it executes the back function I go back to the menu again, but if I try to access another module the functions do not work and return this error:

  

Uncaught TypeError: object is not a function.

Code:

var n= 0;
var divClone=[""] ;  

function clone(){
    divClone[n]=$("#grid").clone();
    n++ 
}

function back(){
    n--;
    $(''#grid'').html(divClone[n]);
}  
    
asked by anonymous 02.02.2015 / 13:16

0 answers