locked
Call function from another file RRS feed

  • Question

  • In my Excel task Pane app al my functions are in the file home.js

    When i replace my function to another file.js it won't works.

    How can i call a function from another file.js?

    Wednesday, July 27, 2016 9:10 AM

Answers

  • To make available yet another file "file.js" you need to make a reference to the file in your HTML page. For example if your start page called "home.html" edit content of the <head> tag and add new <script> tag...

    <head>
    ...
        <script src="your_path/file.js" type="text/javascript"></script>
        <script src="your_path/home.js" type="text/javascript"></script>
    ...
    </head>

    In this case functions from "file.js" file will be available in "home.js" file.

    Hope this helps.

     

    Slava Ivanov


    Great, it works!
    • Marked as answer by Pacecal Wednesday, July 27, 2016 5:38 PM
    Wednesday, July 27, 2016 5:38 PM

All replies

  • To make available yet another file "file.js" you need to make a reference to the file in your HTML page. For example if your start page called "home.html" edit content of the <head> tag and add new <script> tag...

    <head>
    ...
        <script src="your_path/file.js" type="text/javascript"></script>
        <script src="your_path/home.js" type="text/javascript"></script>
    ...
    </head>

    In this case functions from "file.js" file will be available in "home.js" file.

    Hope this helps.

     

    Slava Ivanov

    Wednesday, July 27, 2016 2:00 PM
  • To make available yet another file "file.js" you need to make a reference to the file in your HTML page. For example if your start page called "home.html" edit content of the <head> tag and add new <script> tag...

    <head>
    ...
        <script src="your_path/file.js" type="text/javascript"></script>
        <script src="your_path/home.js" type="text/javascript"></script>
    ...
    </head>

    In this case functions from "file.js" file will be available in "home.js" file.

    Hope this helps.

     

    Slava Ivanov


    Great, it works!
    • Marked as answer by Pacecal Wednesday, July 27, 2016 5:38 PM
    Wednesday, July 27, 2016 5:38 PM
  • what if i want to include a model.cs and controller.cs?

    Friday, August 19, 2016 4:07 PM
  • Hi Pacecal,

    I found you have posted a new thread Parsing controller value to Excel, they are the same issue, am I right? If so, I would suggest you keep following the new thread.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, August 22, 2016 2:15 AM