473,408 Members | 2,402 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,408 software developers and data experts.

onclick question

Hello

We have a page that loads a long list of things. Each row has an onclick
where you can open a window for more information. When you do that the parent
page refreshes to the top of the page....so if you were near the bottom, you
would have to scroll back down to get back to where you were. I would like
the parent page to hold its position when the child opens. Any suggestions?

Thank You
Sep 20 '06 #1
9 1682

"Todd" <To**@discussions.microsoft.comwrote in message
news:A9**********************************@microsof t.com...
Hello

We have a page that loads a long list of things. Each row has an onclick
where you can open a window for more information. When you do that the
parent
page refreshes to the top of the page....so if you were near the bottom,
you
would have to scroll back down to get back to where you were. I would like
the parent page to hold its position when the child opens. Any
suggestions?
>
Thank You
You would need to show us an example of the html and Javascript you are
using to achieve this.

Sep 21 '06 #2
Anthony Jones wrote on 21 sep 2006 in
microsoft.public.inetserver.asp.general:
>
"Todd" <To**@discussions.microsoft.comwrote in message
news:A9**********************************@microsof t.com...
>Hello

We have a page that loads a long list of things. Each row has an
onclick where you can open a window for more information. When you do
that the
parent
>page refreshes to the top of the page....so if you were near the
bottom,
you
>would have to scroll back down to get back to where you were. I would
like the parent page to hold its position when the child opens. Any
suggestions?
>>
Thank You

You would need to show us an example of the html and Javascript you
are using to achieve this.
It is not a asp = serverside, but a clientside issue, off topic.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 21 '06 #3
Todd wrote:
We have a page that loads a long list of things. Each row has an
onclick where you can open a window for more information. When you do
that the parent page refreshes to the top of the page....so if you
were near the bottom, you would have to scroll back down to get back
to where you were. I would like the parent page to hold its position
when the child opens. Any suggestions?
Yes. Stop using <a href="#" onclick="...">. There is no need to use anchor
tags when a change of page is not desired. The [onclick] attribute applies
to virtually every element, not to mention the [cursor] CSS rule:

http://www.w3.org/TR/html4/interact/...l#adef-onclick
http://www.w3.org/TR/CSS21/ui.html#propdef-cursor

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Sep 21 '06 #4
here is the line of code

<td align="center"><a href="#"
onclick="window.open('ncdr.asp?view=ncdr&id=<%=rsn cdr("id")%>','NCDR','toolbar=0,location=0,director ies=0,status=0,menubar=1,scrollbars=1,resizable=0, copyhistory=0,width=740,height=500')"><img
src="../images/view.gif" border="0" alt="View NCDR#
<%=branchloc%>-<%=rsncdr("ncdrnum")%>"></td>

If the onclick is the issue, what would be the best way to achive the same
result

Thank You

"Dave Anderson" wrote:
Todd wrote:
We have a page that loads a long list of things. Each row has an
onclick where you can open a window for more information. When you do
that the parent page refreshes to the top of the page....so if you
were near the bottom, you would have to scroll back down to get back
to where you were. I would like the parent page to hold its position
when the child opens. Any suggestions?

Yes. Stop using <a href="#" onclick="...">. There is no need to use anchor
tags when a change of page is not desired. The [onclick] attribute applies
to virtually every element, not to mention the [cursor] CSS rule:

http://www.w3.org/TR/html4/interact/...l#adef-onclick
http://www.w3.org/TR/CSS21/ui.html#propdef-cursor

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Sep 21 '06 #5
[please do not toppost]

Todd wrote:
<td align="center"><a href="#"
onclick="window.open(...)">

If the onclick is the issue, what would be the best way
to achive the same result
Onclick is not the issue. <ais the issue. Don't use it if it is not
appropriate to do so:

<td onclick="window.open(...)">

Take a look at what I suggested once again:
>Yes. Stop using <a href="#" onclick="...">. There is no need
to use anchor tags when a change of page is not desired. The
[onclick] attribute applies to virtually every element, not
to mention the [cursor] CSS rule:

http://www.w3.org/TR/html4/interact/...l#adef-onclick
http://www.w3.org/TR/CSS21/ui.html#propdef-cursor


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Sep 21 '06 #6


"Dave Anderson" wrote:
[please do not toppost]

Todd wrote:
<td align="center"><a href="#"
onclick="window.open(...)">

If the onclick is the issue, what would be the best way
to achive the same result

Onclick is not the issue. <ais the issue. Don't use it if it is not
appropriate to do so:

<td onclick="window.open(...)">

Take a look at what I suggested once again:
Yes. Stop using <a href="#" onclick="...">. There is no need
to use anchor tags when a change of page is not desired. The
[onclick] attribute applies to virtually every element, not
to mention the [cursor] CSS rule:

http://www.w3.org/TR/html4/interact/...l#adef-onclick
http://www.w3.org/TR/CSS21/ui.html#propdef-cursor

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Thank You...I see what you mean now.....is there a way to replicate the
"finger cursor" that comes up when an anchor is used...looked into
onMouseover but this seems to change the text that the mouse is moving over,
not the curser itself. Appreciate the help
Sep 21 '06 #7
Todd wrote:
>>>...The [onclick] attribute applies to virtually every
element, not to mention the [cursor] CSS rule:

http://www.w3.org/TR/html4/interact/...l#adef-onclick
http://www.w3.org/TR/CSS21/ui.html#propdef-cursor
Thank You...I see what you mean now.....is there a way to
replicate the "finger cursor" that comes up when an anchor
is used...looked into onMouseover but this seems to change
the text that the mouse is moving over, not the curser
itself.
Again, my original response contains the answer. You can use styles inline
or through a CSS rule. Here is inline:

<td stlye="cursor:pointer" onclick="...">


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Sep 21 '06 #8


"Dave Anderson" wrote:
Todd wrote:
>>...The [onclick] attribute applies to virtually every
element, not to mention the [cursor] CSS rule:

http://www.w3.org/TR/html4/interact/...l#adef-onclick
http://www.w3.org/TR/CSS21/ui.html#propdef-cursor
Thank You...I see what you mean now.....is there a way to
replicate the "finger cursor" that comes up when an anchor
is used...looked into onMouseover but this seems to change
the text that the mouse is moving over, not the curser
itself.

Again, my original response contains the answer. You can use styles inline
or through a CSS rule. Here is inline:

<td stlye="cursor:pointer" onclick="...">


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Thank you...I didn't fully understand your original response, however, it
makes perfect sense now...most appreciated!
Sep 21 '06 #9
Todd wrote:
Thank you...I didn't fully understand your original
response, however, it makes perfect sense now...most
appreciated!
My pleasure. It is no surprise to me that you were using <a href="#" ...>,
since there are SO MANY examples out there that use it. This is partly
because there were few alternatives many years ago, and that "trick" worked
for most browsers.

But Microsoft has applied onclick to most elements since version IE4, and
virtually everyone else has done so for the last 5 years, so it is no longer
necessary. Nevertheless, I estimate it will take at least more 5 years for
the practice to fade from documentation and use.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Sep 21 '06 #10

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

Similar topics

8
by: Shock | last post by:
Hello everyone, I am having a problem with the program below. I have isolated the problem to the onclick event that is located throughout arrQuestions. The onclick event refers to a function...
1
by: Will | last post by:
(My 4 questins at end after explination) The code below was provided to me to "Popup" a window explaining what a Credit Card Verification Number is and where to find it on a card... it is used as...
3
by: Jamie Jackson | last post by:
I'm rewriting all links' onclick events, but I'm having a problem. The onclick event that I'm inserting works correctly in Opera, but not in FF or IE. I'm retroactively adding the statement...
2
by: Will | last post by:
(My 4 questins at end after explination) The code below was provided to me to "Popup" a window explaining what a Credit Card Verification Number is and where to find it on a card... it is used as...
2
by: RobG | last post by:
I am trying to dynamically add an onclick to an element, however I just can't get the syntax right. consider the following function: function doClick (evt,x) { // do things with evt and x } ...
2
by: jrsjrs | last post by:
The "filetest.txt" contents is here .................. one/yes two/no three/maybe four/fun five/ok ................ The main program is here
11
by: Daz | last post by:
Hello everyone. I am sure the answer to my question is simple, but I can't seem to dynamically add an onClick event to my script. I have a table which is generated dynamically, I am just...
10
by: Carlos Araya | last post by:
I have the following link on a web page <p class="menuitem"><a href="#" onclick="loadFragment('http://rivendellweb.net/fortress/home', 'index')" title="The Fortress Home">The Fortress...
2
by: =?Utf-8?B?TWFyaw==?= | last post by:
I am writing a control and want to handle an OnClick event on the client-side before then conforming to the postback mechanism. I have got the server-side events working for my OnClick event by...
1
by: sourcie | last post by:
I am changing an existing quiz found on "JavaScriptKit.com Multiple Choice Quiz" I have an image. Instead of using the radio buttons with the normal true/false question, I want to place two...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.