Jump to content

on click


gabrielebr

Recommended Posts

Hi,if I understood well the first example is not acceptable for the accessibility requirements, while the second one is O.K.1) <a href="http://www.parcogeradadda.it" onclick="window.open(this.href); return false;"><img src="parcogera.jpg" alt="parco" style="border-style:none" /></a><br />2) <a href="http://www.parcogeradadda.it" onclick="return confirm('Are you sure you want to view this page?');"><img src="parcogera.jpg" alt="parco" style="border-style:none" /></a><br />BUT the first one opens a new window, while the second, after asking for confirmation, opens a window in place of the current one.Is there any mean to combine both and having a new window that opens IN ADDITION to the current one, after receiving the confirmation ?Thank youregardsGabriele

Link to comment
Share on other sites

Hi,if I understood well the first example is not acceptable for the accessibility requirements, while the second one is O.K.1) <a href="http://www.parcogeradadda.it" onclick="window.open(this.href); return false;"><img src="parcogera.jpg" alt="parco" style="border-style:none" /></a><br />2) <a href="http://www.parcogeradadda.it" onclick="return confirm('Are you sure you want to view this page?');"><img src="parcogera.jpg" alt="parco" style="border-style:none" /></a><br />BUT the first one opens a new window, while the second, after asking for confirmation, opens a window in place of the current one.Is there any mean to combine both and having a new window that opens IN ADDITION to the current one, after receiving the confirmation ?Thank youregardsGabriele

Link to comment
Share on other sites

It's not that difficult to learn, and if you're going to be doing this kind of thing you'll need to learn eventually.
if (confirm('Are you sure you want to view this page?'))   window.open(this.href); return false;

-----------------------wonderful !it works perfectly !!!I know I should learn java, but I should also learn PHP, and a lot of other things but I do it as hobby...it is not my work (I'm a chemist).Thanks to people like you that are always ready to help I already learned quite a lot (I really started from the very beginning).Thank yougabriele
Link to comment
Share on other sites

Well, for accessibility, you should allow the user to decide whether they want to open the link in a new window, and not force that choice upon them. Why do you want the page to be loaded twice anyway?

Link to comment
Share on other sites

Well, for accessibility, you should allow the user to decide whether they want to open the link in a new window, and not force that choice upon them. Why do you want the page to be loaded twice anyway?
It was my answer to the suggestion made by Haris S.I don't need the window to open twice.Thanksregardsgabriele
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...