I have an AIR application (flex 4.6 or flex 4.7), using AdobeAIR3.7 or AdobeAir4.0
I use a HTML browser component
<mx2:HTML id="browser" width="100%" height="100%">
Problem is: when navigating to page, JS gives errors, whereas it works fine with firefox, chrome, ie or safari
When I display the brower navigator.appVersion gives me :
5.0 (windows;u;fr-FR) AppleWebkit/533.19.4(KHTML, like Gecko) AdobeAIR/3.7
5.0 (windows;u;fr-FR) AppleWebkit/533.19.4(KHTML, like Gecko) AdobeAIR/4.0
Maybe this is an OLD version : is there a way to UPDATE the internal browser used by Flex ?
JS script I got in the AIR HTML (I don't get in normal browsers)
ReferenceError: Can't find variable: Uint8Array
TypeError: Result of expression 'messageHandler.on' [undefined] is not a function.
Related
When running an application in Chrome and Firefox, Infragistics UltraWebToolbar.v5.2 control generates "Input string was not in a correct format" exception.
IE is working fine.
Are there any reasons for and solutions to that?
This was fixed in a later volume and you could upgrade to 2011 Volume 1 to resolve this. Note that is the last volume that has the UltraWebToolbar.
I'm using ASP.NET 4.5 on the server and I have a .NET Windows application with a Web Browser control that navigates to the web page on the server.
If I run the Windows application on a system with Internet Explorer 11, I get a script error: "Object doesn't support property or method 'attachEvent'" when navigating to another page. The script file is ScriptResource.axd so it isn't any of my scripts.
I do know that Internet Explorer 11 doesn't support attachEvent anymore (replaced with attachEventListener?). That is however not of much help here, as the javascript is part of the framework, not in my code.
I found the javascript source for the framework here:
http://ajaxcontroltoolkit.codeplex.com/SourceControl/latest#Client/MicrosoftAjax/Extensions/Sys/WebForms/PageRequestManager.js
// DevDiv Bugs 100201: IE does not set referrer header on redirect if you set window.location, inject anchor node instead
// dynamic anchor technique only works on IE
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
var anchor = document.createElement("a");
anchor.style.display = 'none';
// cancel bubble so body.onclick is not raised
anchor.attachEvent("onclick", cancelBubble);
// more code...
}
This is the Sys.Webforms.PageRequestManager module that is part of the core ASP.NET framework as far as I understand.
The line that performs attachEvent gives script error on Internet Explorer 11, but works great on older versions of Internet Explorer.
How to fix this problem? Are there any known workarounds? I couldn't fine any updates for this.
Try forcing the browser to render in IE 10 mode...
<meta http-equiv="X-UA-Compatible" content="IE=10" />
I got that problem with jQuery 1.10 and it seems, that IE11 lacks the support of "attachEvent" which is used in jQuery and which seemed to be used by your framework as well. There is a Microsoft bugticket for that: Bugticket attachEvent IE11
I've found a solution in the related jQuery bugticket. Just insert the following code before your framework:
var isIE11 = !!(navigator.userAgent.match(/Trident/) && !navigator.userAgent.match(/MSIE/));
if (isIE11) {
if (typeof window.attachEvent == "undefined" || !window.attachEvent) {
window.attachEvent = window.addEventListener;
}
}
You first check if the browser is IE11 and then bind the attachEvent listener again so the error doesn't occur again.
I'm trying to play mp3 sound on a webpage, the sound is stored in a SQL database as mp3, so is returned as a byte[] by a Service method.
My problem is that in Chrome this work fine, but in IE it doesn't, as soon as I start to use the ASPX URL as the source then i.e. balks at playing the sound. I have also tried with a little more success but not with a dynamic URL. Am I missing something obvious or is this just IE being difficult. While debugging I find that IE does not even attempt to call this URL it's as tho it has decided that it doesnt like the the URL. Any help much appreciated.
The <audio><source> method
Method i. (does NOT work in IE)
<audio controls="controls" >
<source src="PlayAudio.aspx?AudioId=AUDIO00253" />
Sound Not Supported
</audio>
Method ii. (does NOT work in IE)
<audio controls="controls" >
<source src="Cyclone.mp3" />
Sound Not Supported
</audio>
The <embed> method
Method i. (Does NOT work in IE)
<embed src="PlayAudio.aspx?AudioId=AUDIO00253" autostart="true" ></embed>
Method ii. (DOES work in IE)
<embed src="Cyclone.mp3" autostart="true"></embed>
All four of these methods work fine in Chrome
ASPX method to supply the mp3 byte stream, I know this works fine as it works in Chrome.
private void SendAudio( byte[] audio )
{
// Stream byte array to memory stream
var memStream = new MemoryStream( audio );
// Write memory stream to response
Response.ContentType = "audio/mpeg";
memStream.WriteTo( Response.OutputStream );
memStream.Close();
}
First of all the <audio> & <source> tags are new in HTML 5 which is not supported by IE so they will not work in Internet Explorer (They should work fine in FireFox 4+, Chrome 3+, Safari 4+, Opera 9+, and any other HTML 5 enabled browser.)
Second your code is correct for your method however I have had issues in the past with . I believe the src attribute for the <embed> tag requires an actual sound file not a script to execute.
Right now the browser is trying to play your script which it can't. Since your sound data is stored in a database, on the page with the <embed> tag you would need to create a temp file to write the data to then call that temp file in the <embed> tag.
I am not a total pro at ASPX but I will try to look into it for you.
Cheers :)
I got stuck with this for a moment. Here, embed also didn't work with .aspx or .ashx files on IE, but it did work with classic .asp . Probably there is some kind of validation on the extension. You can add .asp files to modern asp.net visual studio projects.
i m building a web control in aspx 3.5 in which i m using ajax hover menu extender. it works fine in chrome. but in IE8 it crashes when i hover over a button. when i check in chrome error given there is Uncaught ReferenceError: enabalajax is not defined. please help me in this regard
Try using enableajax
you are definitely spelling enable wrong...
I have this code to open an html window from air :
_win = HTMLLoader.createRootWindow();
_win.load(new URLRequest("d:/Content/testEnvironment/bin/index.html"));
this however does not open a real html window but an air window ( i think )
my problem is that when running a swf in this window it does not pop up the error messages even though when running the real html window in IE it does .
What should i do to fix this ?
Thanks
You can use the Navigate to function
navigateToURL(new URLRequest("d:/Content/testEnvironment/bin/index.html"));
This will open the urlRequest in the users default browser.
Once this is done though you will no longer be in your AIR application.