<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=IS>Hi all.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=IS>Let me start by saying that I have, cleared my
cache and private settings, restarted Firefox, restarted MapGuide and restarted
my computer in order to get the newest version of my file to work, but all I
needed after a single change is a refresh (to a .js file). Now, I have this
function that is similar to the ones in Legend so maybe someone can just point
real quick and tell me, here you go.  But there is something I don&#8216;t know
why is happening but I keep getting &#8222;testFunction() is not a function&#8220;
when it get&#8216;s called from only one function.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=IS>This is my function:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>    testFunction : function() {<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>      console.log('not working idiot, what are
you doing wrong!');<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>    },<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=IS>Here are two function calling it.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>    contentLoaded : function(response) {<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>                this.domObj.innerHTML =
response.responseText;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>                this.appendLayerSwitch();<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>                this.testFunction();<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>    },<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=IS>    handleClick : function(layer) {<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>        var startGroup = map.layerRoot;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>        if (!this.showMapFolder) {<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>          startGroup =
map.layerRoot.groups[0];<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>        }<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=IS>        this.testFunction(); // *<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>        for(var i=0;
i&lt;startGroup.groups.length; i++) {<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>          this.handleClick(layer); // **<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>        }<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>    },<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=IS>In the handleClick function I get errors for both
(*) and (**) and I don&#8216;t know why.</span> Maybe I can]t see my error
because I&#8217;m really, really tired after this weekend so any help is
appreciated. I&#8217;ve even tried rewriting all functions. <o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Regards<o:p></o:p></p>

<p class=MsoNormal>T<span lang=IS>ómas<o:p></o:p></span></p>

</div>

</body>

</html>