Forum Discussion

TanIlak's avatar
TanIlak
Contributor
2 years ago
Solved

Calling common function for all the scripts

Hi,

I have two scripts Unit1 and Unit2.

I have imported Unit2 in to Unit1. 

When I try to call function webpagereturn which is in unit2. I am getting the error "Cannot read Property ' webpagereturn' of undefined".
Please refer the below Screen shots and help me to resolve this issue.

I need to call a script function in another script file.

 

Unit1 Screenshot

 

Unit2 Screenshot

Error Screenshot

 

 

  • pwang's avatar
    pwang
    2 years ago

    Hi  Tanlak,

     

    I just add the common js as new item in js. 

    and use the common js by 

     

    var comomon = require("comomon");

     

    must use (" "), not [""]

     

    it works for me.

     

4 Replies

  • Can anyone help me regarding this issue it's a great help for me

    • pwang's avatar
      pwang
      Occasional Contributor

      Hi  Tanlak,

       

      I just add the common js as new item in js. 

      and use the common js by 

       

      var comomon = require("comomon");

       

      must use (" "), not [""]

       

      it works for me.

       

      • TanIlak's avatar
        TanIlak
        Contributor

        Hi Pwang,

        Thanks a lot for your response. [""] this is automatically created while am hitting Import functions now, I changed and works fine.

         

         

        Many thanks