Pulling my hair out. Simple jQuery methods are not working in Safari 6.
The following code block works in all other browsers that I've tested except Safari 6. It works fine in Safari 5 and older, fine in Firefox, fine in IE. It also works fine in Chrome.
The alert does popup in Safari 6, so the function still fired, but nothing happens with any of the other 3 methods.
----- UPDATE ----- After further testing on several machines...I've found that it only fails to work in Safari 6 in Mac OSX 10.8. The code works fine in the same version of Safari in OSX 10.7. --------------------
I am running jQuery 1.8.3. and my page validates as HTML5.
HTML:
<div id="fileUploadFormContainer">
<form id="fileUploadForm" action="/upload/do_upload/<?=$row->project_id?>" method="post" enctype="multipart/form-data" >
<fieldset>
<label for="userfile">Attach a file</label>
<input type="file" name="userfile" id="userfile" /><br />
<input type="submit" id="fileUploadSubmit" value="Upload file" />
<img class="loadingBar" id="fileUploadLoadingBar" src="/images/indicators/ajax-loader.gif" alt="" />
</fieldset>
</form>
</div><!-- end fileUploadFormContainer -->
CSS:
.loadingBar {
display: none;
}
JavaScript:
$(function(){
// Submit Buttons
$('#fileUploadSubmit').click(function()
{
$('#fileUploadSubmit').attr('value', 'Uploading');
$('#fileUploadSubmit').fadeTo('fast',0.6);
$('#fileUploadLoadingBar').fadeIn('fast');
alert('Finished');
});
});