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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:12:04+00:00 2026-05-10T21:12:04+00:00

Greetings! I’m calling a Web service from Javascript when a user clicks on a

  • 0

Greetings!

I’m calling a Web service from Javascript when a user clicks on a link. I need to get the coordinates where the user clicked so that I can display a DIV in an appropriate location. My client-side script looks like the following:

var g_event;  function DoWork(event, theId)  {     if (IsIE())        g_event = window.event;     else         g_event = event;      Acme.WebServices.Worker.GetInformation(theId, DoWorkSuccess); }  function DoWorkSuccess(result)  {     var l_elemDiv = document.getElementById('content-area-div');     DisplayAreaDiv(g_event, l_elemDiv, result); } 

It’s used like this:

<a href='' onclick='DoWork(event, 'help');'>Help</a> 

This works great in Firefox, Safari, and Opera. In IE7, not so much. For example, if I place the following code at the end of both the DoWork() and DoWorkSuccess() functions:

alert(g_event.clientX + ', ' + g_event.clientY);   

In IE, I’ll get two alerts; the first one has correct coordinates, but the second one (which displays on top of the first one) is simply ‘[object]’. Since that ‘[object]’ one is the last one, my DIV is incorrectly displayed in the top left of the browser window. Is there a way I can prevent IE from giving me a second ‘bad’ event? 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. 2026-05-10T21:12:05+00:00Added an answer on May 10, 2026 at 9:12 pm

    Why not extract and save the coordinates in DoWork and simply use them in DoWorkSuccess rather than saving the event. Of course this won’t work if there is more data you are extracting from the event.

    var client_x; var client_y;  function DoWork(event, theId)  {     var g_event;     if (IsIE())        g_event = window.event;     else         g_event = event;      client_x = g_event.clientX;     client_y = g_event.clientY;      Acme.WebServices.Worker.GetInformation(theId, DoWorkSuccess); }  function DoWorkSuccess(result)  {     var l_elemDiv = document.getElementById('content-area-div');     DisplayAreaDiv( { clientX : client_x, clientY : client_y }, l_elemDiv, result); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 92k
  • Answers 92k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION LIKE '%your text… May 11, 2026 at 6:29 pm
  • Editorial Team
    Editorial Team added an answer You can do it in Python 3 like this: (a,… May 11, 2026 at 6:29 pm
  • Editorial Team
    Editorial Team added an answer First of all, inline JavaScript (href="javascript:x" or onclick="x") is generally… May 11, 2026 at 6:29 pm

Related Questions

Greetings, I'm trying to find a way to 'unbind' a socket from a particular
Greetings. I'm looking for a way to parse a number of XML files in
Greetings! I'm working on wrapping my head around LINQ. If I had some XML
Greetings, I'm trying to find either a free .NET library or a command-line executable
Greetings, I need a way (either via C# or in a .bat file) to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.