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

  • Home
  • SEARCH
  • 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 6602107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:50:15+00:00 2026-05-25T18:50:15+00:00

I normally set up my javascript code to have a function. But due to

  • 0

I normally set up my javascript code to have a function. But due to the fact that the application generates most of the HTML and javascript calls from a VB6 application I would like to create a jQuery function that is more like a listener. So for example if I have a td tag that has the class ‘gridheader1’ I would like the jQuery to wait for it to be clicked.

I’m assuming that I would use the bind… But I’m getting javascript errors with it… If you can offer suggestions on where my code is wrong that would be great.

$('.gridheader1').bind('click', function()
{
  alert('hi I got clicked');
});

Again this just has to sit out there on the main .js file. It isn’t attached to any functions. Please let me know.

Thanks

  • 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-25T18:50:16+00:00Added an answer on May 25, 2026 at 6:50 pm
    // static tags
    $(function(){ // DOM ready
       $('.gridheader1').click(function()
       {
         alert('gridheader1 clicked');
       });
    });
    
    
    // or if the tag is loaded via ajax use 'live'...
    $(function(){ // DOM Ready
       $('.gridheader1').live('click', function()
       {
         alert('gridheader1 clicked');
       });
    });
    
    
    // or if you already have a function defined that you want to call, you can pass in the function instead of using an anonymous function.
    
    function alertAboutStuff(){
      alert('gridheader1 clicked');
    }
    
    $(function(){
       $('.gridheader1').click(alertAboutStuff);
       // $('.gridheader1').live('click', alertAboutStuff); // for tags loaded via ajax
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Normally I create web application projects and use code-behind, but I have a requirement
I have a strictly browser based JavaScript and xlst application. It's normally used on
Do you normally set your compiler to optimize for maximum speed or smallest code
I have a set of 10 CSV files, which normally have a an entry
Is there a way that I can Programmatically set an Expires Header in code
I have a result set returned from a database that takes a few seconds
Normally you create a function using cfscript like: <cfscript> function foo() { return bar;
Normally I use imagecreatefromjpeg() and then getimagesize() , but with Firefox 3 I need
Normally, in Delphi one would declare a function with a variable number of arguments
I have a form that is added through the nodeapi displayed only on view

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.