Summary: Internet Explorer either gives a popup or does nothing when making a XmlHttpRequest via SmartClient's datasource.fetchdata() if the server (CORS enabled) is on a different domain. It works flawlessly in other browsers.
SmartClient Version: v9.1p_2015-03-13/PowerEdition Deployment (built 2015-03-13)
Browsers that work:
Chrome Version: 41.0.2272.89 m on Windows 8.1 Pro x64
Chrome Version: 40.0.2214.109 on Android Lollipop
Firefox Version: 36.0.1
Opera version: 28.0.1750.40
Browser that does not work
Internet Explorer 11 Version: 11.0.9600.17.631 on Windows 8.1 Pro x64
Received Popup Stating "This page is accessing information that is not under its control. This poses a security risk. Do you want to continue?"
Internet Explorer 11 on Windows Phone 8.1
Receive popup "contacting server" message. (The call never actually makes it to the server) And the page looks like its broken
The Setup:
SmartClient enabled server deployed to an Amazon EC2 instance.
CORS Enabled: "Access-Control-Allow-Origin: *" returned in header
Extended BasicDatasource and overrided executeFetch.
Client uses static HTML and Javascript files deployed to Amazon S3 and used as a static web hosting
Here is a sample client script with CORS enabled on my server
Code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Smart Client Test</title>
<script type="text/javascript" >var isomorphicDir="isomorphic/";</script>
<script type="text/javascript" charset="UTF-8" src="isomorphic/system/modules/ISC_Core.js"></script>
<script type="text/javascript" charset="UTF-8" src="isomorphic/system/modules/ISC_Foundation.js"></script>
<script type="text/javascript" charset="UTF-8" src="isomorphic/system/modules/ISC_Containers.js"></script>
<script type="text/javascript" charset="UTF-8" src="isomorphic/system/modules/ISC_Grids.js"></script>
<script type="text/javascript" charset="UTF-8" src="isomorphic/system/modules/ISC_DataBinding.js"></script>
<script type="text/javascript" charset="UTF-8" src="isomorphic/skins/Mobile/load_skin.js"></script>
</head>
<body>
<br><br><br>
<button onclick="fetchData()">Fetch data from different server</button>
<br><br>
<div id="fetchedData"></div>
<script>
//Data source that will call cross origin server
isc.DataSource.create({
ID:"webCategoryDataSource",
dataURL: "http://qa.juxappose.com/isomorphic/IDACall",
fields:[
{
title:"Category ID",
primaryKey:true,
name:"categoryId",
type:"text",
required:true
},
{
title:"Name",
name:"name",
type:"text",
required:true
},
]
});
//function that is used to fetch the data
fetchData = function(){
webCategoryDataSource.fetchData(null, function(dsResponse, data, dsRequest){
var list = "<ul>";
for(var i = 0; i < data.length; i++)
list += "<li>" + data[i].name + "</li>";
list += "</ul>"
document.getElementById("fetchedData").innerHTML = list;
});
}
</script>
</body>
</html>
And here is the callstack from IE Dev Tools.
Code:
isc_c_Comm_sendXmlHttpRequest [Line: 1103, Col: 1], ISC_Core.js
isc_c_RPCManager__sendQueue [Line: 1504, Col: 44], ISC_DataBinding.js
isc_c_RPCManager_sendQueue [Line: 1452, Col: 49], ISC_DataBinding.js
isc_c_RPCManager_sendRequest [Line: 1327, Col: 179], ISC_DataBinding.js
isc_DataSource_performSCServerOperation [Line: 2405, Col: 53], ISC_DataBinding.js
isc_DataSource_sendDSRequest [Line: 803, Col: 12], ISC_DataBinding.js
isc_DataSource_performDSOperation [Line: 777, Col: 50], ISC_DataBinding.js
isc_DataSource_fetchData [Line: 740, Col: 94], ISC_DataBinding.js
fetchData [Line: 52, Col: 5], test.html
onclick [Line: 21, Col: 20], test.html
Questions:
1. Is there something I can do to make sure that IE desktop does not get the popup?
2. Because there is no popup on IE on Windows Phone the server is never called so therefore the page is broken. Is there a way around this?
I have also attached a standalone test case.
Thanks in advance.
shatta_deya