jquery - SCRIPT5: Access is denied IE09 and IE10 -
i'm using rails 3.2.11. have implemented file upload concept. working fine firefox , chrome browser.
form
<iframe id="upload_target" name="upload_target" style="display:none;"></iframe> <%= form_tag(url_for(:action => 'add_image'), :target => 'upload_target', :id => 'add_image_form', :enctype => 'multipart/form-data', :multipart=>true) %> <%= text_field 'image_asset', 'name', :size => [60,40].min, :maxlength => "60", :id => "focus", :style=>"display:none", :value=>"site_logo" %> <%= text_field 'image_asset', 'image_type', :value=>"icon",:style=>"display:none"%> <input type="file" id="file" name="image_form_file" size="36" style="display:none;" /> <a href="#" class="button" onclick="$('#file').click();">upload new logo image</a> <a href="#" class="button green" onclick=" $('#add_image_form').submit();">save</a> <% end %>
jquery
$('#file').live("change",function() { $('#add_image_form').submit(); settimeout(function(){ $.ajax({ type: "get", beforesend: function(xhr){ xhr.setrequestheader('x-csrf-token', $('meta[name="csrf-token"]').attr('content'))}, datatype: "html", url: "/get_image", data: "record_id=<%= @page.id%>&format=html", success: function(data){ $('#site_logo').html(data); var new_image = $('#site_logo').find("img").attr('src'); }, error: function(){ } }); }, 6000)
i have issue in ie 9, ie 10 browser. java script console throws "script5: access denied."
i have tried allow permission folder location not useful. c:\users[username]\appdata\local\microsoft\internet explorer\domstor c:\users[username]\appdata\local\packages\windows_ie_ac_001\ac\microsoft\internet explorer\domstore
any suggestion
thanks
try wrap button anchor in label tags:
<input type="file" id="file" name="image_form_file" size="36" style="display:none;" /> <label for="file" class="button">upload new logo image</label>
clicking label trigger file input without invalidating form internet explorer.
(tested in ie9 & ie10)
Comments
Post a Comment