Question on javascript dojo

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Question on javascript dojo

Charles Dosantos
Not sure if this is the correct mailing list for such questions.

I used dojo 8 years ago, so i am very new to the dojo 1.7+. 

when I call the following function in alter statement  alert(fillReportTable(13))

I except the value 13, but instead , the whole function definition is begin returned. 
Appreciate your help.

<script>
       
        function fillReportTable(repId)
        {
        return  require(['dojo/_base/lang'],function (lang) 
        {
            
            var obj = { a:"b", c:"d" };
            var thing = lang.clone(obj);
            return repId;
        });  
        };
        
         alert(fillReportTable(13))
        
    </script>

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question on javascript dojo

derekpdx
if all you want to receive from the fillReportTable function, try the following:

<script>
       
        function fillReportTable(repId)
        {
        // return  require(['dojo/_base/lang'],function (lang) 
        require(['dojo/_base/lang'],function (lang) 
        {
            
            var obj = { a:"b", c:"d" };
            var thing = lang.clone(obj);
            return repId;
        });  
        };
        
         alert(fillReportTable(13))
        
    </script>


On Thu, Dec 1, 2016 at 7:30 AM, Charles Dosantos <[hidden email]> wrote:
Not sure if this is the correct mailing list for such questions.

I used dojo 8 years ago, so i am very new to the dojo 1.7+. 

when I call the following function in alter statement  alert(fillReportTable(13))

I except the value 13, but instead , the whole function definition is begin returned. 
Appreciate your help.

<script>
       
        function fillReportTable(repId)
        {
        return  require(['dojo/_base/lang'],function (lang) 
        {
            
            var obj = { a:"b", c:"d" };
            var thing = lang.clone(obj);
            return repId;
        });  
        };
        
         alert(fillReportTable(13))
        
    </script>

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest



--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...