मैंने एक कोणीय ऐप बनाया है और इसमें JS API लाइब्रेरी का उपयोग करना चाहता था। मैं इस ऐप का उपयोग Office 365 Outlook के अंदर करना चाहता हूं। हालांकि, मैं निम्न त्रुटि हो रही है:Uncaught TypeError: window.external.GetContext एक फ़ंक्शन नहीं है
Uncaught TypeError: window.external.GetContext is not a function
OSF.InitializationHelper.getAppContext @ o15apptofilemappingtable.js:11
मैं एक ब्राउज़र पर index.html चला रहा हूँ और अंत में मैं अंदर कार्यालय 365 दृष्टिकोण से यह चला जाएगा।
index.html:
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Office 365 APIs sample</title>
<base href="/">
...
...
<!-- JavaScript Office API -->
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type="text/javascript"></script>
<!-- App code. -->
<script src="scripts/app.js"></script>
<script src="controllers/homeController.js"></script>
</head>
<body>
</body>
</html>
app.js:
(function() {
console.log("STARTING...");
var init = function (reason) {
$(document).ready(function() {
console.log("ready");
});
};
try {
Office.initialize = init;
if(!window.external.GetContext) {
console.log('Not in office context');
init();
}
} catch(e) {
// when in office context unable to access external
console.log(e);
}
});
कृपया मुझे बताएं कि किसी को भी इस त्रुटि का सामना किया जाने नीचे कोड है। मुझे वेब पर खोज करके इसका कोई समाधान नहीं मिला।
धन्यवाद!
मुझे भी एक ही समस्या का सामना करना पड़ता है लेकिन मेरा सुझाव इस दृष्टिकोण का उपयोग नहीं करना है, मेरा मतलब है कि 'window.external.GetContext' को जांचना अच्छा नहीं है। मेरे पास अभी कोई समाधान नहीं है लेकिन इस प्रश्न को रोकना कुछ वैध सुझावों के साथ उत्तर दिया जाएगा। – Hitendra
ब्राउज़र में यमन उत्पन्न एप चलाने के दौरान यहां एक ही समस्या प्राप्त करें। क्या अजीब बात है: जब आप होस्टेड o15apptofilemappingtable.js फ़ाइल खोलते हैं, तो यह कहता है: "एक्सेल विशिष्ट API लाइब्रेरी"। Euhm? आउटलुक में? अजीब। – Jasper
आपने समस्या का समाधान कैसे किया? – herrh