Signin  Pricing  Examples  Support

Libraries > script.js

script.js - Search Live Website Code
It's like doing CTRL+F on millions of websites' source code



NerdyData is a search engine for source code. Search the source code of 200 million websites.


JAVASCRIPT FILE http://javjavav.com/js/script.js


Libraries on javjavav.com






Explore More


rotator.js

web-all.js

lightbox.js

prototype.js

script.js
				
$(function(){
    $.extend({
        hsc : function(str) {
            if (!str) return;
            str = str.replace(/&/g, "&");
            str = str.replace(/"/g, """);
            str = str.replace(/'/g, "'");
            str = str.replace(/</g, "&lt;");
            str = str.replace(/>/g, "&gt;");
            return str;
        },
        repTag : function(text) {
            if (!text) return '';
            text.replace(/\n\r/g, '\n');
            var rtext = text.replace(/\r/g, '\n'),
                lines = rtext.split('\n'),
                replacedText = lines.join('<br>');
            return replacedText;
        },
        enc : function(str) {
            if (!str) return;
            var replaceText = encodeURIComponent( $.repTag( $.hsc(str) ) );
            return replaceText;
        }
    });

    $('#toTop').on('click', function(){
        $('html, body').animate({
            scrollTop : 0
        }, 'fast');
    });

    $('#toggleMenu').on('click', function(){
        $(this).toggleClass('active');
        $('#menuWrapper').slideToggle(200)
    });

    $('.js-countupClick').on('click', function(){
        var id = $(this).attr('data-contents-id') || '';
        if (id.length > 0) {
            $.ajax({
                url  : '/api/count_up/' + id,
                type : 'GET'
            });
        }
    });

    $('#searchActress').on('keyup', function(){
        var _text = $.enc( $(this).val() ) || '';
        if ( _text.length > 0 ) {
            $.ajax({
                url   : '/api/search_actress',
                type  : 'POST',
                dataType: 'html',
                data  : {
                    'text' : _text
                }
            })
            .done(function( data ) {
                $('.init-actress-list').hide();
                if (data.length > 0) {
                    $('#searchActressList').append(data);
                } else {
                    $('.result-list').remove();
                    $('.init-actress-list').show();
                }
            })
            .fail(function(data) {
                $('.result-list').remove();
                $('.init-actress-list').show();
            })
        } else {
            $('.result-list').remove();
            $('.init-actress-list').show();
        }
    });

});


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z