0

网站在这里

我正在从数据库中提取值并将它们显示在图像上两个框中的右侧框中。中间有四个值:价格、队列跳转、交易 1 和交易 2。我的问题是,并非每个报价都包含所有 4。但是,div 的边距值本来应该是一个间距间隙. 除了将 div 放在数据库字段中之外,我还能做些什么来避免这种情况?

这是我的Javascript:

<script type="text/javascript">

    $(document).ready(function() {
        $.ajax({
            type: "POST",
            url: "http://cambridge.guestvibe.com/wp-content/themes/cambridge/eventinfo.php",
            data:  $('#club').serialize(),
            success: function(data) {
                $('#rightbox_inside').html('<h2><div class="tagnospacing">' + $('#club').val() + '</div></h2><p><div class="tagnospacing">' + data[0].day + '</div></p><hr><p><div class="tag">' + data[0].entry + '</div></p><p><div class="tag">' + data[0].queuejump + '</div></p><p><div class="tag">' + data[0].special + '</div></p><p><div class="tag">' + data[0].special2 + '</div></p><p><div class="tag">' + data[0].closing + '</div></p><hr><p><div id="caveat">All offers subject to availability</div></p>');
                },
            dataType: "json"
        });
    });

    $('#club').change(function(event) {
        $.ajax({
            type: "POST",
            url: "http://cambridge.guestvibe.com/wp-content/themes/cambridge/eventinfo.php",
            data:  $(this).serialize(),
            success: function(data) {
                $('#rightbox_inside').hide().html('<h2><div class="tagnospacing">' + $('#club').val() + '</div></h2><p><div class="tagnospacing">' + data[0].day + ', ' + data[0].doors + '</div></p><hr><p><div class="tag">' + data[0].entry + '</div></p><p><div class="tag">' + data[0].queuejump + '</div></p><p><div class="tag">' + data[0].special + '</div></p><p><div class="tag">' + data[0].special2 + '</div></p><p><div class="tag">' + data[0].closing + '</div><hr><p><div id="caveat">All offers subject to availability</div></p>').fadeIn('500');
                },
            dataType: "json"
        });

    });

</script>
4

0 回答 0