Not able to call a function in a namespace from the html file

Burescesk

New Member
I have two javascript file which has some fucntions within a name space. But when i try to invoke this function from my main page it is throwing an error telling "Object # has no method 'LoadAllBooks'".. But i have invoked the the function by using namespace.function.Here is the code in the Javascript file Util.js\[code\]var myNameSpace = { Book: function (author, title, URL) { this.author = author; this.title = title; this.URL = URL; }, LoadAllBooks: function (metadata, attachPoint) { Some Code-- }, arr: [], oneBook: {}};\[/code\]Now the above function LoadAllBooks is called from my html home page as shown below.\[code\]<script> var attachpoint = document.querySelector('.buttonAttachPoint'); $(document).on('load',myNameSpace.LoadAllBooks("ajax/metadata.json",this.attachpoint));</script>\[/code\]Could some please tell me why this is giving out an error?
 
Back
Top