Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jquery-test info popup function

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #45318
    mmcgu1966
    Participant

    After grumping about several of my new-project pet peeves this morning, I wrote a quick jquery function that is shows the current jQuery and jquery-ui version as well as window height and width. Just comment-out the ‘jQuery-test();’ line to disable. The popup appends to .I thought it might come in handy for somebody and would appreciate feedback (the helpfull kind)

    $(document).ready(function() {
    jQuery_test();

    function jQuery_test() {
    var jQueryVersion = $().jquery;
    if ($.ui){
    var jQueryUiVersion = $.ui.version;
    }
    var javascriptAlert = ‘

    ‘+

    Jquery Test

    ‘+

    ‘+

    jquery: ‘ + jQueryVersion +’

    ‘+

    jquery-ui: ‘ + jQueryUiVersion +’

    ‘+

    window-width: ‘+$(window).width()+’

    ‘+

    window-height: ‘+$(window).height()+’

    ‘+

    ‘+

    ‘+

    ‘;
    $(‘body’).append(javascriptAlert);

    $(‘.jquery-test-button’).click(function() {
    $(‘.jquery-test-content’).toggle(200);
    });

    $(window).resize(function() {
    $(‘.jq-test-width’).text($(window).width());
    $(‘.jq-test-height’).text($(window).height());
    });
    }

    )};

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.