Giter VIP home page Giter VIP logo

Comments (9)

kbrandl avatar kbrandl commented on June 8, 2024

@chicagocomputerclasses sorry to hear that you're having trouble with fetch. Since using fetch to make web calls relates to general web development (and isn't specifically tied to Office Add-ins), I'd suggest you check out the Using Fetch article within the MDN docs. If you can't get things to work after reading that documentation, I'd suggest that you post to Stack Overflow and tag your question with fetch-api. You might also want to search already-existing questions/answers within that tag on Stack Overflow, as it's quite possible that the information you need already exists there.

from office-js-snippets.

chicagocomputerclasses avatar chicagocomputerclasses commented on June 8, 2024

Hi kbrandi, thanks, but I use fetch all the time for general web development and Node JS.

The question is whether fetch is included within Script Lab plugin environment, because it returns undefined and if it's not how can it be added as a library.

I can't find Script Lab documentation about adding libraries. Can you point me to it?

from office-js-snippets.

kbrandl avatar kbrandl commented on June 8, 2024

@chicagocomputerclasses thanks for clarifying your ask; I'll re-open this issue and see what I can find out about this.

from office-js-snippets.

kbrandl avatar kbrandl commented on June 8, 2024

Actually, @AlexJerabek has some info to share about this, so I'm going to hand this off to him. Thanks @AlexJerabek!

from office-js-snippets.

AlexJerabek avatar AlexJerabek commented on June 8, 2024

Hi @chicagocomputerclasses,
@Zlatkovsky created a gist using fetch in Script Lab: https://gist.github.com/Zlatkovsky/522183067333a47d8ec4f7e8a4823c57
It's a custom function that queries a stock ticker.

He notes that on IE11 you need to include the “fetch” polyfill. “whatwg-fetch” is a common one: https://github.com/github/fetch

Let me know if that helps unblock you.

from office-js-snippets.

AlexJerabek avatar AlexJerabek commented on June 8, 2024

Also, for context, older versions of Office Add-ins use the IE11 browser engine to display the web contents. Here's an article with that information: https://docs.microsoft.com/office/dev/add-ins/concepts/browsers-used-by-office-web-add-ins

from office-js-snippets.

AlexJerabek avatar AlexJerabek commented on June 8, 2024

Tagging @ElizabethSamuel-MSFT for awareness about Script Lab doc needs.

from office-js-snippets.

AlexJerabek avatar AlexJerabek commented on June 8, 2024

Hi @chicagocomputerclasses,

Did the provided information unblock you using fetch with Script Lab? We're looking to improve our Script Lab documentation and will figure out how to best address this documentation gap.

I'm going to close the issue, but please respond to the thread if you need something else and I'll happily reopen it. Thanks!

from office-js-snippets.

chicagocomputerclasses avatar chicagocomputerclasses commented on June 8, 2024

"Also, for context, older versions of Office Add-ins use the IE11 browser engine"

Sorry for not replying earlier but this has resolved my problem. I wasn't aware of this. After running window.navigator.userAgent I've discovered that it was in fact using Internet Explorer. I'm still not entirely sure why, because the system was windows 10 and office was 365 with newest updates. Anyhow, using a polyfill fixed this issue.

Thank You!

from office-js-snippets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.