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 6114469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:58:43+00:00 2026-05-23T14:58:43+00:00

I am able to reverse engineer jQuery, but I now have to learn how

  • 0

I am able to reverse engineer jQuery, but I now have to learn how to forward engineer. I know how to write JavaScript functions, and I know that within JavaScript functions, you can use jQuery. However, I am really stuck with trying to make a function out of the following code:

$(document).ready(function(){
    function doStuff( bar )
    {
        // Match all <A/> links with a title tag and use it as the content (default).
        $('.graph').qtip({
            content: {
                text: 'Loading...', // The text to use whilst the AJAX request is loading
                ajax: {
                    url: '/foo/' + bar , // URL to the local file
                    type: 'GET', // POST or GET
                    data: {} // Data to pass along with your request
                }
            },
            show: {
                solo: "true",
                delay: 100,
                event: "click",
                adjust : {screen : true}
            },
        });
    }
});

This code works great, but only if I remove the

function doStuff( bar )
{
}

The reason that I want to wrap that stuff in a function is so that I can pass in a parameter. Like I said, I can work with jQuery, but I am far from a master. Any help or advice/critique of my strategy is welcome.

Edit

This is where I call the function. Thanks for all the help too!

<a class="graph" title="a_link_title" href="#" onclick="doStuff('281'); return false;"> a link </a>
  • 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-23T14:58:43+00:00Added an answer on May 23, 2026 at 2:58 pm

    First thing

    this function shouldn’t be inside document.ready

     function doStuff( bar )
     {
    
     }
    

    The code is not executing because of htis function , unless you call this function it doesn’t work.

    You can do two things. call the function or remove the function and move out of document.ready and call it inside document.ready

    $(document).ready(function(){
       doStuff(bar) // pass the value and call it like this
    });
    
        function doStuff( bar )
        {
            // Match all <A/> links with a title tag and use it as the content (default).
            $('.graph').qtip({
                content: {
                    text: 'Loading...', // The text to use whilst the AJAX request is loading
                    ajax: {
                        url: '/foo/' + bar , // URL to the local file
                        type: 'GET', // POST or GET
                        data: {} // Data to pass along with your request
                    }
                },
                show: {
                    solo: "true",
                    delay: 100,
                    event: "click",
                    adjust : {screen : true}
                },
            });
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know if this is even possible but I'd like to be able
I want implement forward geocoding in my app. But I am not able to
Application able to record error in OnError, but we are not able to do
I'm able to connect to and read an excel file no problem. But when
I want to be able to capture the exception that is thrown when a
I have a Visual Studio (2010) package that combines multiple text operations, e.g. it
I was able to instantiate a working scroller using jQuery Jcarousel however I need
We are using reverse-geocoding in a rails webservice, and have run into quota problems
I was wondering if anyone knew how to reverse engineer an Access Database. I
I want to reverse engineer (import into diagram form) the database definition dump of

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.