Can anyone see why this would work in FF but not Safari? When I alert the return from my CF script that processes the image and returns the image name it works in FF. No go in Safari...
$( "#uploadform" ).submit(function( objEvent ){
//alert("Submit");
var jThis = $( this );
var strName = ("uploader" + (new Date()).getTime());
var jFrame = $( "<iframe name=\"" + strName + "\" src=\"about:blank\" />" );
jFrame.css( "display", "none" );
jFrame.load(function( objEvent ){
var objUploadBody = window.frames[ strName ].document.getElementsByTagName( "body" )[ 0 ];
var jBody = $( objUploadBody );
var objData = eval(jBody.html());
var thumb = ('holding/' + eval(jBody.html()));
setTimeout(function(){
jFrame.remove();
},100);
if (objData !== '') {
// Put the preview here and load another form that has a hidden element capturing the image name
// then use a button to save the image, close the window and update the database with all the info
// and relaod the main page with a location.reload
$('#imagePreview').attr('src', thumb );
$('#imageName').html(thumb);
$('#imagePreview').click(function(){
rebinder();
});
} else {
alert("no thumbnail");
}
});
$( "body:first" ).append( jFrame );
jThis
.attr( "action", "upload_act_single.cfm" )
.attr( "method", "post" )
.attr( "enctype", "multipart/form-data" )
.attr( "encoding", "multipart/form-data" )
.attr( "target", strName );
});
I'm thinking I must have some syntax errors messing up the works but I'm new enough to this to not see it. When I use the alert to call out the objData variable it says 'undefined' in Safari. It acts like it doesn't even run the CF script... Thank you in advance for any help.