Note : This issue was specific to the chrome version 34 which has been fixed in the later versions & this workaround is no more needed.
Hey All,
If you get an error as below when you do oData Create,
Open your console and execute the below code & check if your app works (don't refresh after executing this code in console) https://gist.github.com/arv/9529994
if (!Document.prototype.createAttributeNS) {
Document.prototype.createAttributeNS = function(namespaceURI, qualifiedName) {
var dummy = this.createElement('dummy');
dummy.setAttributeNS(namespaceURI, qualifiedName, '');
var attr = dummy.attributes[0];
dummy.removeAttributeNode(attr);
return attr;
};
}
if (!Element.prototype.setAttributeNodeNS) {
Element.prototype.setAttributeNodeNS = Element.prototype.setAttributeNode;
}
If your app works like a charm :smile: , then the reason for the above error is just because Chrome has removed some DOM Level 2 API's. Internally data.js in UI5 uses two functions
document.createAttributeNS() , document.setAttributeNodeNS()
which have been removed from chrome's API. The workaround code would manually add those functions to the DOM's document Object.
So, till this is fixed you can create a new js file say, workaround.js and copy the code posted above and import it to your ui5 app index.html as
<script src="workaround.js"></script>
Once this issue is resolved, you can remove the workaround script :smile: This is one of the workaround available.
For FIORI Apps that are loaded through component rather than index.html , you can do either of below steps.
(OR)
Note : I'd suggest you can go for 1st approach only if you know how to import javascript using jQuery.sap.require else go for the second one.
Regards
Sakthivel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
38 | |
19 | |
13 | |
13 | |
11 | |
10 | |
10 | |
10 | |
8 | |
8 |