Looking for code converter

bfuchs
bfuchs used Ask the Experts™
on
Hi Experts,

Wondering if there is a site or program that will translate a code snipped into plain English?
The way it has to convert it into computer language (binary format 0001011100) , it should be something for ordinary people (beginners) too...

Something like the following

//hide default submit button row at the bottom of inline forms
$(document).ready( function() {
    $( '.cb-hide-submit input[type="submit"]' ).closest( 'tr' ).remove();
    $( '.cb-btn-reset' ).bind('click', function() {
        $( this ).closest( 'form' ).find( 'select, input[type="text"]' ).val( '' );
        $( this ).closest( 'form' ).submit();
    });
    checkBrowser();
    $("form").on(":submit", function(event) {
        if(!checkBrowser()) {
            event.stopImmediatePropagation();
        }
    });
});

Open in new window



Where could I see what each line of code is supposed to do?

PS. If there is a converter from JQuery to VBA that would also be helpful (in my case).

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Daniel PineaultPresident / Owner CARDA Consultants Inc.
Distinguished Expert 2018
Commented:
I doubt either exists, especially the latter since they aren't common in the sense that not all methods/properties/functions exists in VBA that exist in jQuery so there'd be no way to translate such code.

Your best bet is to use Google, official documentation https://api.jquery.com/ and use forums such as EE.
Multitechnician
Top Expert 2014
Commented:
the tools you're looking for doesn't exists because programming language is not something to translate to human but to machine (and by machine, we talk about a logical translator (interpretor) until the next machine revolution)

for common JavaScript we use : https://developer.mozilla.org/en-US/
as suggested by Daniel Pineault, to undertand the jQuery part we use : https://api.jquery.com/

// wait when DOM ready mean the skeleton of the page is loaded,
// not yet image,iframe, just the full page content
$(document).ready( function() {
    // locate an element with the class cb-hide-submit
    // locate a child of the element, a input with the type "submit"
    $( '.cb-hide-submit input[type="submit"]' )
        // locate the closest(parent) tr tag of this input submit element
        .closest( 'tr' )
        // and remove it and its content from the page
        .remove();
    // locate an element witht the class cb-bt-reset
    $( '.cb-btn-reset' )
        // run a function when someone click on it
        .bind('click', function() {
        // when someone click on it run the following :
        // check the form element of this element (the one the user click on)
        // find all select and textbox elements and set their value to empty
        $( this ).closest( 'form' ).find( 'select, input[type="text"]' ).val( '' );
        // also finally submit the form
        $( this ).closest( 'form' ).submit();
    });
    // run the function checkBrowser
    checkBrowser();
    // run a function when the form is going to submit
    $("form").on("submit", function(event) {
        // run the function checkBrowser which return true or false
        if(!checkBrowser()) {
            // if it return false (!false is true)
            // prevent the form to submit
            event.preventDefault();
            // don't send the submit order to other(next) subscribers of the submit event
            event.stopImmediatePropagation();
        }
    });
});

Open in new window

Thank you!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial