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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:13:14+00:00 2026-06-17T16:13:14+00:00

Is it possible to have lets say, a link where I have it look

  • 0

Is it possible to have lets say, a link where I have it look like

<a href="something/" class="something" data-callback="thisFunction">
<a href="something/" class="something" data-callback="thatFunction">
<a href="something/" class="something" data-callback="anotherFunction">
<a href="something/" class="something" data-callback="">

<script>
     $('.something').click(function(e)
     {
        e.preventDefault();
        var cb = $(this).data('callback');
        if(cb !== undefined && cb !== null && cb !== '')
        {
           //somehow use cb as a means to call another function
           //similar in effect to calling "thatFunction();"
        }
     });
    function thisFunction()
    {
       //code
    }
    function thatFunction()
    {
       //code
    }
    function anotherFunction()
    {
       //code
    }
</script>

If it is possible, how would I achieve making it work, and what is the actual reference for that type of call like what is the method called for doing that so in the future if I forget hopefully I’ll I remember what the method is called and I can just look that up.

  • 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-06-17T16:13:15+00:00Added an answer on June 17, 2026 at 4:13 pm

    You can use the following:

    window[cb]();
    

    Or to be on the safe side:

    typeof window[cb] === "function" && window[cb]();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: C printing bits Lets say I have a uint16_t number something like:
Possible Duplicate: Adding members to an existing object Lets say you have the following
Possible Duplicate: How Do I Access This Variable? Lets say I have the code:
Let's say I have a class of 30 students and want generate every possible
Lets say I define class with method like this: class Test { public function
Let's say I have a links like this: http://mysite.com?i=343435&f=224&u=334 and this link is constant
Lets say I have this kind of set of images: <div class=image><img src=image1.jpg alt=
Is it possible to create an intellisense-like link to a class / class property
Let's say we have the following list: <ul> <li><a href=#>Link 1</a></li> <li><a href=#>Link 2</a></li>
Is it possible to have relative path w.r.t to a certain path(lets say /home/krg85/stackoverflow)

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.