473,395 Members | 1,653 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,395 software developers and data experts.

Java script problem

hi all .....
this is my simple problem. In my web page , there are loy of links to
other pages. a user comes and click on a link . it wil navigate to
other pages... i need to know what link he is clicking , in javascript
or java .......

Mar 16 '06 #1
3 1337
mk******@gmail.com wrote:
hi all .....
this is my simple problem.
Indeed, your simple problem is that you don't know how to write subject
lines. They need to be more specific than "Java script problem".
Besides, JavaScript is one word.
In my web page , there are loy of links to
other pages. a user comes and click on a link . it wil navigate to
other pages... i need to know what link he is clicking , in javascript
or java .......


Why do you _need_ to know?

Are we talking of links within your website or to other websites?

The answer is likely to be that it can't be done with either JavaScript
or Java alone. But if you clarify what you are trying to achieve, then
maybe someone will be able to point you to a means by which it can be
done, _if_ it can be done.

Stewart.

--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:- C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS-
PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y
------END GEEK CODE BLOCK------

My e-mail is valid but not my primary mailbox. Please keep replies on
the 'group where everyone may benefit.
Mar 16 '06 #2
mk******@gmail.com a écrit :
hi all .....
this is my simple problem. In my web page , there are loy of links to
other pages. a user comes and click on a link . it wil navigate to
other pages... i need to know what link he is clicking , in javascript
or java .......


Try this :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8"
http-equiv="content-type" />
<title>Test</title>
<script type="text/javascript">
function onClick(elem) {
alert(elem.name);
}
</script>
</head>
<body>
<a name="link1" onclick="onClick(this)"
href="http://link1.com">Link1</a>
<br />
<a name="link2" onclick="onClick(this)"
href="http://link2.com">Link2</a>
</body>
</html>
Best regards

Roger
Mar 16 '06 #3
Roger (Bordeaux) wrote:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Nonsense, especially in combination with ...
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8"
http-equiv="content-type" />
.... this line. Understand that an XML parser cannot care about this. If
it ever encounters this line, it is far too late to make anything right.
Well-formedness requires that the encoding of the markup is known _before_
the parse tree is built, i.e. declared in the Content-Type HTTP header or
with an XML Process Instruction on top of the document.

See also
<URL:http://groups.google.com/group/comp.infosystems.www.authoring.stylesheets/browse_thread/thread/635c04af4300224b/a4b644f8fc73570e#a4b644f8fc73570e>
(whole thread)

<URL:http://www.hut.fi/u/hsivonen/xhtml-the-point>
<URL:http://hixie.ch/advocacy/xhtml>

That said, even a HTML UA MUST NOT care about this if the encoding specified
with the Content-Type HTTP header is different; the latter MUST take
precedence over the former, according to RFC1945/RFC2616 (HTTP/1.x).

This line is useful for HTML UAs and _HTML_ documents _not served via
HTTP_ /only/. Usually it is redundant because the UA should include it for
HTML documents when they are saved as a file. (However, there are some
broken UAs and misconfigured servers out there [having ISO-8859-1 or worse
as _default_ that cannot be overridden by users]. It is no excuse to rely
on broken meta-parsing behavior, though.)
<title>Test</title>
<script type="text/javascript">
function onClick(elem) {
Since using this identifier is error-prone, it should be different.
alert(elem.name);
}
Do you even know that if this was parsed by an XML parser and it contained
"<" or ">", you would have to declare it CDATA or write "&lt;" and "&gt;"?
Probably not.
</script>
</head>
[...]

PointedEars
Mar 18 '06 #4

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

Similar topics

4
by: Andy R. | last post by:
Hello everyone, I've spent quite some time now, looking for some information on how to get this done, sadly none has helped me much, though. I have a bit of java scrpt on a webpage (.php) to...
3
by: StealthMonkey | last post by:
Let me prefix this by saying that I know next to nothing about Java (so please try to keep explainations simple). I use PHP for my server-side web programming. Here is my dilemma: I need a...
4
by: Don Grover | last post by:
I hope some one can help, I have a html table that is created with asp that has a row of repeated buttons down the side. these call a page passing a query string with invoice number. I need to...
18
by: Mickey Segal | last post by:
On comp.lang.java.programmer we are discussing problems created for Java programs by pop-up blockers (in the thread "showDocument blocked by new microsoft pop-up blocker"). Our problem is that...
34
by: kpg | last post by:
Hello all, I have an asp.net web application with tons of Java script files. I would like to protect the Java Script somehow so it can't be seen by a remote user. I found several 3rd party...
9
by: Stephen H. | last post by:
Hi, I have an existing web application with java beans that I wanne migrate to ASP.NET using C#. The existing web application has some jsp files that use java beans as follows: .... <%@...
7
by: dbabin | last post by:
I have a java script function enableServerList() {document.getElementById("ddlServers").disabled=false } function disableServerList() {document.getElementById("ddlServers").disabled=true } ...
4
by: Quill_Patricia | last post by:
I have a Python script which is used to load data into a database. Up to now this script has been run by customers from the Windows command prompt using "python edg_loader.pyc". Any error messages...
0
by: tosreejithp | last post by:
Hi, My first problem was i am not able to compiled a file from java script to java class.Now its clear and working fine..now i can convert a java script file to java class by Rhino Java Script...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.