Note that there are some explanatory texts on larger screens.

plurals
  1. POtwitter bootstrap modal won't work on first call
    primarykey
    data
    text
    <p>I'm practicing with twitter bootsrap and made an example website. I use modal view to display warnings when users vote. But it won't display the warning when you vote first time. it displays second time. if you go to <a href="http://test.erdemece.com/" rel="nofollow">my test site</a> and click on up arrow you will see nothing will be displayed. but when you click one more time you will see the modal message.(which is saying you have to be logging to vote in my language) I cannot figure out why it's happening. thanks for your help.</p> <p>this is my jquery.</p> <pre><code>&lt;script&gt; jQuery(document).ready(function($){ $('.upvote').click( function(event) { event.preventDefault(); var voteID = $(this).attr("id"); $.ajax({ url: "/ajax.php?Page=votetitle", type: "post", dataType: "json", data: {id : voteID, vote: '1'}, success: function(data){ if(data.success == 'true'){ $('#voteresponse'+voteID).html(data.message); }else{ $(".upvote").attr("data-toggle", "modal"); $(".upvote").attr("data-target", "#modal"); $('#modal').modal('show'); $('#modal').on('show', function () { $('.ModalLabel',this).html('Oy verirken hata oluştu!').css({color: 'red'});; $('.modal-body',this).html(data.message); }); } }, error:function(){ $('#voteresponse').popover({ title: 'Hata!', content: 'Server hatasi' }); } }); }); $('.downvote').click( function(event) { event.preventDefault(); var voteID = $(this).attr("id"); $.ajax({ url: "/ajax.php?Page=votetitle", type: "post", dataType: "json", data: {id : voteID, vote: '2'}, success: function(data){ if(data.success == 'true'){ $('#voteresponse'+voteID).html(data.message); }else{ $(".downvote").attr("data-toggle", "modal"); $(".downvote").attr("data-target", "#modal"); $('#modal').modal('show'); $('#modal').on('show', function () { $('.ModalLabel',this).html('Oy verirken hata oluştu!').css({color: 'red'});; $('.modal-body',this).html(data.message); }); } }, error:function(){ $('#voteresponse').popover({ title: 'Hata!', content: 'Server hatasi' }); } }); }); }); &lt;/script&gt; </code></pre> <p>modal html</p> <pre><code> &lt;div id="modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;×&lt;/button&gt; &lt;h3 class="ModalLabel"&gt;&lt;/h3&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button class="btn" data-dismiss="modal" aria-hidden="true"&gt;Kapat&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>and buttons</p> <pre><code>&lt;button type="submit" class="btn btn-mini upvote" id="'.$data['ContentID'].'"&gt;&lt;i class="icon-arrow-up"&gt;&lt;/i&gt;&lt;/button&gt; &lt;span id="voteresponse'.$data['ContentID'].'"&gt;'.intval( $data['TotalVotes'] - $data['VoteSum'] ).'&lt;/span&gt; &lt;button type="submit" class="btn btn-mini downvote" id="'.$data['ContentID'].'"&gt;&lt;i class="icon-arrow-down"&gt;&lt;/i&gt;&lt;/button&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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