when i want to define constructor function as property of my object in sub function it's shows fallowing error when i call constructor function: 

```
'undefined' is not a function (evaluating 'arr[0].myval()')

```

i define my object like below code's

```
function stocks(nemad,url,content) {
    this.url=url;
    this.nemad=nemad;
    this.content=content;
    var me=this;
    nemad = require('webpage').create();
    nemad.open(url, function (status) {
        this.myval=function () {
            return nemad.evaluate(function() {
                var myans=document.getElementById("d12").innerHTML;
                return myans;
            }); };
    }); };

```

when i call `console.log("it's :"+arr[0].myval());`it's not working .. where i make mistake