Cannot assign to a function result
Hi,
I keep getting this error message when I'm testing Popfly. I have created a simple block but when I try to build a mash with it I get the above mentioned error message.
I cannot find the error in the code. Is there any good way to verify block code and get decent error messages referring to lines etc?
Couple of things that might be causing problems:
Code Snippet
City.prototype.toString() = function()
The () on the troString isn't needed that's true for all functions using the prototype. Instead:
Code Snippet
City.prototype.toString = function()
This assigns a function to a the toString field which is what you want to do, though i believe both ways work in IE.
Also you don't need the __ on getCities, the node:
Code Snippet
<operation name="getCities" callMode="both">
Has an attribute "name" which needs to match the name of the function in javascript in this case either change the xml attirbute to __getCities or rename the function. The use of __ is not required any more to hide functions in the designer.
Lastly you need to change:
Code Snippet
for (var index = 0; i< locationArray.length; index++)
to
Code Snippet
for (var index = 0; index < locationArray.length; index++)
I didn't test the block, so there might be more if so just post back here
.