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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:33:19+00:00 2026-05-20T21:33:19+00:00

Wondered if there was good way to do this, thought I would post to

  • 0

Wondered if there was good way to do this, thought I would post to the SO community…

There is a 3rd party web page that I have no control over how it renders, but they allow me to add JQuery.

Using the JQuery, I am creating a nav menu on the side of the page, it will be a list of links. The onclick event of these links I get from existing onclick events already on the page, but when I do a:

var linkLoc = $('#theLink').attr("onclick");

linkLoc returns:

function onclick(event) {
  handleJumpTo("com.webridge.entity.Entity[OID[E471CB74A9857542804C7AC56B1F41FB]]", "smartform");
}

instead of what I would expect:

handleJumpTo("com.webridge.entity.Entity[OID[E471CB74A9857542804C7AC56B1F41FB]]", smartform");

I think JQuery is trying to get the event for binding, but I need the actual Javascript markup since I’m creating the HTML dynamically. I guess I could substring the “function onclick(event) {” out, but seems kind of hacky.

Any ideas of an elegant way I could get the onclick markup?

  • 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-20T21:33:20+00:00Added an answer on May 20, 2026 at 9:33 pm

    The type of $('#theLink').attr("onclick") is a function, so you can just use that when you bind events to the links.

    var linkLoc = $('#theLink').attr("onclick");
    $('a#link1').live('click', linkLoc);
    

    Example: http://jsfiddle.net/BdU6f/

    You can also run other code in the click handler too, if you need:

    var linkLoc = $('#theLink').attr("onclick");
    $('a#link1').live('click', function(e){
        // Code...
        linkLoc(e);
    });
    

    Example: http://jsfiddle.net/BdU6f/1/

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

Sidebar

Related Questions

I have a working selector but I just wondered whether there was another way
Hi is there a good way to implement drop downs so that they're functional
I wondered if there is a programming language which compiles to machine code/binary that
I wondered if someone might have some insight into this. jqGrid is quite happy
I just wondered whether there is any good reason for or even an advantage
I'v always wondered this. In a game like GTA where there are 10s of
I have an error/exception that is thrown by a particular method. Any time this
Are there any good data access layer generators for Java? I have not used
I have this bit of PHP that I'd like to do the equivalent of
Is there a easy / good way of getting the url from the URLLoader

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.