Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6754547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:17:37+00:00 2026-05-26T13:17:37+00:00

Can you help me convert this jquery to javascript? Thanks. <script> $(document).ready(function() { $(a.false).click(function(e)

  • 0

Can you help me convert this jquery to javascript? Thanks.

    <script>
        $(document).ready(function() {
            $("a.false").click(function(e) {
                $(this).closest("tr.hide").hide("slow");
                var main_id = this.title;
                var display = "false";
                e.preventDefault();
                $.ajax({
                    url: "/useradminpage",
                    data: {main_id: main_id, display: display},
                    success: function(data) {
                    //display_false();
                    }
                });
            });
        });
    </script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:17:38+00:00Added an answer on May 26, 2026 at 1:17 pm

    Yes you can, but your going to have to learn ES5, DOM4 & XHR2.

    // Create the toArray utility
    var toArray = function (obj) {
        var arr = [];
        for (var i = 0, len = obj.length; i < len; i++) {
            arr[i] = obj[i];    
        }
        return arr;
    };
    

    You need an toArray utility to manipulate NodeList and HTMLCollection.

    var as = toArray(document.getElementsByClassName("false")).filter(function (el) {
        return el.tagName === "A";
    });
    

    Here you need to get all the class='false' elements and then filter then by whether they are <a> elements.

    as.forEach(function (el) {
        var parentTr = el.parentNode;
        do {
            if (parentTr.tagName === "TR" && parentTr.classList.contains("hide")) {
                return; 
            }
            parentTr = parentTr.parentNode;
        } while (parentTr !== null);
    

    For each element you want to find the parent <tr>. You do this by looping up the parentNode chain as shown. You also need to handle the parentTr === null case more elegantly

        el.addEventListener("click", function (ev) {
            // Make a CSS3 animation class
            parentTr.classList.add("hide-slow");
            var main_id = this.title;
            var display = "false";
    

    Attach a click handler. Change your jQuery hide animation to be done with hard ware accelerated CSS3

            var xhr = new XMLHttpRequest();
            xhr.open("GET", "/useradminpage");
            xhr.addEventListener("readystatechange", function (ev) {
                if (xhr.readyState === XMLHTTPRequest.DONE) {
                    // display_false();   
                } 
            });
            xhr.send({
                main_id: main_id,
                display: display 
            });
    

    Open a XHR2 request. Point it at your url with the GET method. Then attach a readystatechange listener and finally send data down the request.

        }); 
    });
    

    Disclaimer: Browser support is a pain. You will need the following shims

    • ES5-shim
    • DOM-shim
    • XHR2 shim doesn’t exist. I’ll write one at some point.

    Further reading:

    The interfaces I have used are

    • Element
    • EventTarget
    • XMLHTTPRequest

    You should also read up on ES5.1

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone help convert this this actionscript to Objective-c? if(mcMain.y >= stage.stageHeight - mcMain.height)
Hi can someone help me convert this tsql statement into c# linq2sql? select [series]
I have been struggling to get this right! Can anyone help me to convert
Currently I have the below jQuery which uses the colorbox plugin http://colorpowered.com/colorbox/ $(document).ready(function(){ $(.altbgcolor).hover(function()
Can someone help me convert this sqlite query to a postgres query? SELECT count(*),
Can anyone help me convert this code to make it run recursively? I'm not
I am new to SQL. Can someone help to convert this query, so it
I am having trouble understanding how the System Registry can help me convert a
Can any one help me convert the below code to LINQ? Select Catg,Count(*) From
can someboody please help me convert these strings/ints into a usable font thing? it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.