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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:07:15+00:00 2026-05-26T16:07:15+00:00

I have a pretty specific question. I am trying to implement an onclick and

  • 0

I have a pretty specific question. I am trying to implement an onclick and cross domain tracking within a block of text, but it looks like it may need to be put directly into a .js document. I don’t have a lot of JS experience. Basically, the current code looks like:

// JavaScript Document
function popup_no_status(loc)
{
var windowW=1000
var windowH=700
s = "width="+windowW+",height="+windowH+",status=yes, resizable=yes, scrollbars=yes";
mywin = window.open(loc ,'CBE', s);
mywin.focus();
}

What I want to add to this is:

onclick="pageTracker._trackEvent('Button', 'Click', 'QuickSearchWidget'); pageTracker._link(this.href); return false;

Can I just add it to the end of the document before the closing bracket? Any Ideas?

Much appreciated!

  • 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-26T16:07:16+00:00Added an answer on May 26, 2026 at 4:07 pm

    As long as the object pageTracker is defined and instantiated, you can call its methods like any other function:

    function popup_no_status(loc) {
        var s = "width=700,height=1000,status=yes, resizable=yes, scrollbars=yes";
        var mywin = window.open(loc ,'CBE', s);
        mywin.focus();
    
        pageTracker._trackEvent('Button', 'Click', 'QuickSearchWidget');
        pageTracker._link(this.href);
    }
    

    Also, the variables windowW and windowH are pointless in your example code – there is no need to store the string values in a variable if all you’re going to do is concatenate them into another string. Further, unless you intend the mywin and s variables to be global, you should use the var keyword before defining them – that restricts the variables to the function scope instead of the global scope (all variables declared in a function without the var keyword are considered global).

    If the code above gives an error like ReferenceError: pageTracker is not defined, that means that the code in which the pageTracker object is defined is either not included on the page, or it has not been instantiated.

    Now… as for onClick, I am not clear what you’re after here. Do you want this function to run when someone clicks the document? That would get pretty annoying!

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

Sidebar

Related Questions

Sorry for a pretty specific question. I have a table (see bottom), and when
This is a pretty specific question, albeit possibly subjective, but I've been using this
So, the context of this question is pretty specific, but I think there is
Pretty simple but specific question here: I'm not entirely familiar with the JPEG standard
I have a pretty specific one here. I'm basically Trying to post an array
I know this is a pretty specific question but I managed to get some
I have pretty much finished my first working Symbian application, but in my hastened
i have pretty simple simple question (i hope so). How do i change the
I have built a PHP calendar system and have pretty much everything done but
I have a pretty basic question that confuses me for some strange reason. I

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.