1
我想用jQuery/ajax和odata實現一個自定義的web資源。我遇到了麻煩,並最終發現,當我打電話:ClientGlobalContext.js.aspx在Dynamics 2011中被破解?
var serverUrl = context.getServerUrl();
代碼拋出異常。
但是,當我更改serverUrl到文字網址,它的工作原理。然後我發現論壇帖子說我應該通過去https://[org url]//WebResources/ClientGlobalContext.js.aspx
驗證手動驗證我的.aspx頁面。當我這樣做,我收到一個警告頁面:
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
Invalid at the top level of the document. Error processing resource 'https://[org url]//WebResources/Clien...
document.write('<script type="text/javascript" src="'+'\x26\x2347\x3b_common\x26\x2347\x3bglobal.ashx\x26\x2363\x3bver\x2...
到底什麼意思呢?
你能張貼了網絡資源的代碼?這可能是一個格式問題。 – glosrob
'ClientGlobalContext.js.aspx'是一個腳本,你應該包含你的web資源,以便能夠訪問你試圖獲取服務器URL的行的上下文。 'var serverUrl = context.getServerUrl();'這個腳本很可能沒有被正確的引用,導致'serverUrl'變量沒有被設置,並導致其他所有內容被破壞。 – Chris
我在我的根htm文件中引用它爲:
我現在已經很晚了,但希望這會對其他面臨這個問題的人有用。 直到如今甚至R15有兩種可用的ClientGlobalContext.js.aspx
我不知道爲什麼存在1.但它會導致許多問題,如:
return window.USER_GUID;
實施爲確保您的網址是正確的只要按照the link發表@克里斯
來源
2014-03-19 20:22:33