Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with jquery tools overlay in Safari
    text
    copied!<p>I am trying to present a form inside an overlay. The form is loaded via ajax. This all works fine on firefox 3.x.</p> <p>But on Safari 5.0(5533.16), the overlay shows but does not make an ajax request, rather makes a html request.</p> <p>Here is how I configure it in my js and then on document.ready I call ModalPostForm.init();</p> <p>pastie - <a href="http://pastie.org/1196064" rel="nofollow">http://pastie.org/1196064</a></p> <pre><code>var ModalPostForm = { init: function(){ $("a[rel='#post_overlay']").each(function(){ //alert($(this).attr('href')); $(this).overlay({ closeOnClick: false, target: '#post_overlay', fixed: false, onBeforeLoad: function() { // grab wrapper element inside content var wrap = this.getOverlay().find(".contentWrap"); // load the page specified in the trigger wrap.load(this.getTrigger().attr("href")); }, onLoad: function() { setTimeout("configurePostForm(200, 1000, 150)", 500); }, onClose: function() { $('.contentWrap').empty(); } }); }); }, close: function(){ $("a[rel='#post_overlay']").each(function(){ var ol = $(this).data("overlay"); if(ol.isOpened()){ ol.close(); } }); } }; </code></pre> <p>Here is my html</p> <pre><code>&lt;div id="post_overlay" class="new-post-overlay span-12" style="top: 54.3px; left: 429px; position: absolute; display: none;"&gt;&lt;a class="close"&gt;&lt;/a&gt; &lt;div style="display: none;" id="form_loading" class=""&gt; &lt;div class="loading-inner-center"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div id="" class="contentWrap"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Why is it issuing html request?</p> <p>Thanks</p> <h2>UPDATE</h2> <p>This goes away if I remove the format.html block in my rails respond_to block in my controller actions.</p> <p>Though the question remains why it it sending a html request or why rails thinks it is a html request. I would rather not remove that block, for browsers that indeed can't do js.</p> <h2>new action which causes the issue</h2> <pre><code> respond_to do |format| # format.html # new.html.erb format.js { } # format.xml { render :xml =&gt; @post } end </code></pre> <h2>edit action which also causes the issue, both new and edit happen to be 'get' methods.</h2> <pre><code># format.html { # if @edit # # # setup_post_items(true) # else # flash[:error] = 'Sorry no further edits, Post has already been approved.' # redirect_back_or_default root_url # end # } format.js { if !@edit flash[:error] = 'Sorry no further edits, Post has already been approved.' end } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload