473,382 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Coordinates solution...

Sorry for inconveniance, but I couldn't check the newsgroup since friday. I
can't see any solutions right now on my post... So, one more time... (if
anyone noticed the solution)...

I have javascript that shows exact mouse coordinates on screen: (see script
bellow).

I should submit those coordinates to page2.asp when I click on image that is
placed on page1.asp Anyone knows the easiest solution...?

<p>
<img src="image.jpg"
alt="Graficki prikaz - jpeg" usemap="#map1">
<map id="map1" name="map1">
<area coords="490,10,350,200" href="page2.asp">
</map>
</p>
<!-- Part One:
Set up a form named "Show" with text fields named "MouseX"
and "MouseY". Note in the getMouseXY() function how fields
are addressed, thus: document.FormName.FieldName.value
//-->

<form name="Show">
<input type="text" name="MouseX" value="0" size="4"> X<br>
<input type="text" name="MouseY" value="0" size="4"> Y<br>
</form>

<!-- Part Two:
Use JavaScript ver 1.2 so older browsers ignore the script.
The &lt;script> must be *after* the &lt;form> -- since the form
and fields must exist *prior* to being called in the script.
//-->

<script language="JavaScript1.2">
<!--

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0

// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) {
if (IE) { // grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft
tempY = event.clientY + document.body.scrollTop
} else { // grab the x-y pos.s if browser is NS
tempX = e.pageX
tempY = e.pageY
}
// catch possible negative values in NS4
if (tempX < 0){tempX = 0}
if (tempY < 0){tempY = 0}
// show the position values in the form named Show
// in the text fields named MouseX and MouseY
document.Show.MouseX.value = tempX
document.Show.MouseY.value = tempY
return true
}

//-->
</script>
</body>
</html>
Jul 19 '05 #1
3 2068
Need_help wrote:
Sorry for inconveniance, but I couldn't check the newsgroup since
friday. I can't see any solutions right now on my post... So, one
more time... (if anyone noticed the solution)...

I have javascript that shows exact mouse coordinates on screen: (see
script bellow).

I should submit those coordinates to page2.asp when I click on image
that is placed on page1.asp Anyone knows the easiest solution...?
...


This is a client side scripting issue which is very much on-topic at
news:comp.lang.javascript which is over there ---->

Just a thought: Have you considered how you will capture the data when
client-side script is disabled?

--
William Tasso - http://WilliamTasso.com
Jul 19 '05 #2
Try to look cop.jang.javascript
Jul 19 '05 #3
Fix your clock...

Cheers
Ken

"Need_help" <no****@nospam.hr> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
: Sorry for inconveniance, but I couldn't check the newsgroup since friday.
I
: can't see any solutions right now on my post... So, one more time... (if
: anyone noticed the solution)...
:
: I have javascript that shows exact mouse coordinates on screen: (see
script
: bellow).
:
: I should submit those coordinates to page2.asp when I click on image that
is
: placed on page1.asp Anyone knows the easiest solution...?
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John Paine | last post by:
Hi All, I've been struggling with how best to define a query to get a list of unique coordinates from a database table and my SQL skills are not good enough to work out a good solution. The...
1
by: Patrick Medina | last post by:
Hi, i have tried to write the code for a drop-down menu with css, javascript and html. In a "normal" occasion i would make it with divs and apply absolute coordinates to all. ...
4
by: K.N.Ranjit | last post by:
Hi to all friends out there, I'm facing this problem for atleast 2 days but still have'nt yet solved my problem.I send the mail few days back (ie) in VB.net how to shift my form coordinates (ie)...
4
by: Tomasz Bak | last post by:
Hello, I have a simple problem: mark a list of defects on an image. I think the best way to do it is to select a single deffect, then take two coordinates of coursor form an image on a web...
1
by: Ian Davies | last post by:
I think javascript ans CSS is the solution for my problem. I wish to use them to retreive the relative coordinates of an element on webpage and store it in an text field on pressing a button. or...
3
by: jackiepatti | last post by:
QUESTION: I have a web page containing a form that contains an image instead of a submit button, e.g. <form name='myform' action='get' method='otherpage.asp'> <input type='image'...
1
by: BryanM | last post by:
I have an asp.net site that uses a dropdown listbox to select 1 of 6 different images to be displayed at one time. Changing the image is working fine. But I need to define and use a different set of...
4
by: victor.herasme | last post by:
Hi, i am using a software which uses python as its scripting language. I want to generate a list of coordinates more or less this way: for i in (beg, end, step): for j in (beg, end, step):...
0
by: raylopez99 | last post by:
keywords: logical coordinates, page coordinates, world coordinates, device coordinates, physical coordinates, screen coordinates, client coordinates. offset rectangle. WYSIWYG rubber rectangle...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.