Uploadify OnAllComplete with alert crashes FF4 - asp.net

I have implemented on my page the Uploadify plugin and I am having some trouble with the onAllComplete event with Firefox 4.
I have it implemented like this:
$(document).ready(function() {
$('#file_upload').uploadify({
'uploader' : 'js/uploadify.swf',
'script' : 'UploadVarios.ashx',
'cancelImg' : 'js/cancel.png',
'folder' : '/uploads',
'multi' : true,
'auto' : true,
'buttonText' : 'Escolher ficheiros',
'removeCompleted' : false,
'fileExt' : '*.doc;*.docx;',
'fileDesc' : 'Ficheiros Word',
onError : function (event,ID,fileObj,errorObj) {
document.forms["form1"].elements["nroErros"].value = 1
}
,
onAllComplete : function(event,data) {
if(document.forms["form1"].elements["nroErros"].value > 0) {
alert('ERROR!');
document.forms["form1"].elements["nroErros"].value = 0;
}
}
});
});
The idea is that if any of the files to be uploaded reports an error, at the end of the upload task an alert message appears.
This works well on IE and on Chrome, but on FF4 after showing the alert and when i try to click on the OK, FF crashes completely.
Any idea on what's going on here?

AS far as I can tell this is a problem related to the alert of Javascript and Firefox 4 and not related to Uploadify itself.
I ended up removing the alert, adding a div on my page and modifying the div content on error.
Not the prettiest job but it works at least on all 3 major browsers.

I had the same problem with Firefox 5 and Uploadify. If you have Firebug installed and if you're just using the alert for debugging during development, you could replace alert('ERROR!'); with console.log('ERROR!');

Related

VR view for the web : error unable to load texture

I try to use vr view for the web in localhost. https://developers.google.com/vr/develop/web/vrview-web
My code is :
<script>
window.addEventListener('load', onVrViewLoad)
function onVrViewLoad(){
var view = new VRView.Player('#vrview', { image : 'img.jpg', is_stereo: false, width: 857, height: 297});
}
</script>
<div id='vrview'></div>
My error is :
Render: unable to load texture from "file: ... img.jpg"
I already read every posts on this problem.
I try to use the cardboard camera converter but I have already an equirectangular-panoramic image and it says :
"Conversion error: no valid right eye image found in the XMP metadata.
This might not be a valid Cardboard Camera image."
I don't know why it doesn't work.
Can you help me ?
PS : sorry for my english...

jPlayer 2.6.0 not playing audio throwing no supported source found error

I am using jQuery jPlayer for audio files in my project. Earlier it was just fine but now all of a sudden it's just not working but throwing errors as:
GET http://traffic.libsyn.com/vemsagenda/vemsagenda0.mp3 net::ERR_EMPTY_RESPONSE
Uncaught (in promise) DOMException: Failed to load because no supported source was found.
jPlayer 2.9.2 : id='jquery_jplayer_1' : Error!
It is not possible to play any media format provided in setMedia() on this browser using your current options.
Video or audio formats defined in the supplied option are missing.
Context: {supplied:'mp3'}
I am not getting idea as what is wrong all of a sudden. It was working just fine.
jsfiddle: https://jsfiddle.net/bxwkyhsb/12/
Code:
$('#jquery_jplayer_1').jPlayer({
ready: function () {
$(this).jPlayer('setMedia', {
mp3: '".$audio_link[$i]."'
});
},
play: function() { // To avoid multiple jPlayers playing together.
$(this).jPlayer('pauseOthers');
equal_height_pod();
},
swfPath: 'js',
supplied: 'mp3',
wmode: 'window',
globalVolume: true,
smoothPlayBar: true,
keyEnabled: true,
preload: 'none',
errorAlerts: true,
warningAlerts: true
});
$('#jquery_jplayer_1').bind($.jPlayer.event.play, function() {
$('.jp-audio').removeClass('showcontainer').parent('figure').parent('.leftImg').parent('li').removeClass('titlewrap');
$('#jp_container_1').addClass('showcontainer').parent('figure').next('.introtitle').addClass('wrapintrotitle');
$('#jp_container_1').parent('figure').parent('.leftImg ').parent('li').addClass('titlewrap');
});
Any help/suggestions are welcome. Thanks in advance.
supplied: 'mp3'. Try that. It's missing in your example.
The code is working just fine. As #Martin Mazza Dawson said it's due to network problem(firewall). You can play it using chrome extension 'Browsec'.

Trying to catch hideDropdown event in TextExt.js

I am using TextExtJs for an autocomplete feature where you start typing and the dropdown of suggestions appears below the text input and you can select a suggested option with arrow keys or mouse.
Everything is working great except that I am trying to perform a function after the user selects one of the suggestions. There is a hideDropdown event which I think is the proper event to use for this. Unfortunately I'm not understanding how to do this, this is what I have tried:
$('#usearch').textext({
plugins : 'autocomplete ajax',
ajax : {
url : 'usersuggest.php',
dataType : 'json',
cacheResults : true
},
autocomplete : {
onHideDropdown : function(){
alert('A happened');
},
hideDropdown : function(){
alert('B happened');
}
},
onHideDropdown : function(){
alert('C happened');
},
hideDropdown : function(){
alert('D happened');
}
});
None of these functions with the alert actually ever run. They do not interfere with the suggestion piece of it. How do I attach a callback to this event?
I'm facing the same problem here....
Unfortunately there is no proper solution. The manual is as rudimental as the examples provided on the plugin page.
I managed to bind a kind of "onAddingTag" event, refer to this: http://textextjs.com/manual/plugins/tags.html#istagallowed
$('#textarea').textext().bind('isTagAllowed', function(e, data) {
var valueAdded = data.tag;
data.result = true; //needs to be done, since we're abusing this event
};
Despite the fact that this may help with this issue, your next problem would be: when does the user remove a tag?
Finally I ended up, using another autocomplete library.

YUI and Phantom/CasperJS : issue with Y.get callback

I use YUI 3 as my main Javascript library and CasperJS for testing.
In my application I load CSS dynamically. I utilize Y.Get.css like this:
Y.Get.css(
'#my_cssFile#',
{
attributes : {
id : "#css_ID#"
},
async : true,
onEnd : function () {
myCallbackFunction();
}
}
);
When I run tests with CasperJS the myCallbackFunction() is never called.
I read that some browsers have not implemented the loadEvent on link elements. CasperJs however, use a Webkit core. I suspect that something else is causing this.
I also tried using the pollInterval attribute, but with no result.
Is there a way to call a callback after loading CSS with casperJS?

JQueryUI Dialog IE9 not opening

I have an aspx page that contains a dialog box defined with JQueryUI
$('#dialog').dialog({
modal: true,
autoOpen: false,
minWidth: 500,
title: 'my dialog',
buttons: { Finished: function() { $(this).dialog("close"); }
}
});
Within the page I have a button which is supposed to open the dialog
<button class="button" id="dialogLoader">Open</button>
The JavaScript for opening the dialog is
$('#dialogLoader').live('click', function(event) {
event.preventDefault();
$('#dialog').dialog("open");
loadDialogContent();
});
In Chrome Firefox etc all is good but IE9 does not load the dialog, even though when debugging all code appears to execute fine.
Any Ideas
UPDATE
Still have this problem I have updated the code above to show that I am now utilising preventDefault(); which I thought was the cause of the problem (if the problem is indeed event bubbling). but I still have no remedy to this if this was plain HTML it would work but I fear the involvement of ASP has caused some irregularity in rendering, which unfortunately returns no error.
UPDATE
Could the fact that this button is within JQueryUI tabs be causing the issue in IE9?
as you wrote your debug info is clean, this is just one idea. I hope this helps a little bit. attachEvent for Explorer.
var button = document.getElementById('dialogLoader');
if (button.addEventListener) {
button.addEventListener('click', function() {
//action
}, true);
} else if (button.attachEvent) {
button.attachEvent('click', function() {
//action
}, true);
}

Resources