I am currently building an application on Windows Phone 7 using the WebBrowser control. The WebBrowser is navigated to a URL, but I also inject my own javascript into the control.
However the code which seems to work well on other platforms (WebView for Android and iOS) doesn't seem to work in the WebBrowser:
function parseToString(outObject)
{
var outJSON = null;
try{
if(outObject != null){
outJSON = JSON.stringify(outObject);
}
}
catch(err)
{
outJSON = err.message;
}
window.external.Notify(outJSON);
}
I found out that the "control JSON is undefined" is thrown in the try block.
Can someone recommend an alternative method for stringifying the JSON in the WebBrowser/IE? Furthermore, I cannot use external libraries as those javascripts are injected into the WebBrowser.