Here is part of my code
Actual Code:
Top:
var NS = (function (global)
{
Middle:
var ViewH =
{
portfolio: function ( embeddedAml )
{
internals
},
Bottom:
return {
ViewHPortfolio: ViewH.portfolio,
};
})(window);
However, IE is reporting that var1 is undefined. I define it in the function parameter list and use it in the function. Not too sure what the interpreter is realy saying.
These functions worked until I moved them into a common object – Container
Also IE would not let me pass Container.func1 so I passed it to the HTML as ContainerFunc1.
Question is, how do I get the interpreter to recognize the variables var1, var2…etc.
Thanks,
I think you’re a victim of semicolon insertion.
Change this:
to this:
Also, I think this
Should be this
Finally, be aware that when you do
And you say
even though this function—
ContainerFunc1—points toContainer.func1thethisinside the call will not beContainer;thiswill be resultObj.Finally, by convention functions that start with a capital letter in JavaScript are intended to be used as a constructor. To comport with this convention you should consider changing the name to
topwith a lowercaset.