gabrielebr Posted November 2, 2010 Share Posted November 2, 2010 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 More sharing options...
gabrielebr Posted November 2, 2010 Author Share Posted November 2, 2010 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 More sharing options...
justsomeguy Posted November 2, 2010 Share Posted November 2, 2010 Instead of returning the value from confirm, use it in an if statement to open a new window. Link to comment Share on other sites More sharing options...
[dx] Posted November 2, 2010 Share Posted November 2, 2010 Maybeonclick="confirm('Are you sure you want to view this page?'); window.open(this.href);" Link to comment Share on other sites More sharing options...
gabrielebr Posted November 2, 2010 Author Share Posted November 2, 2010 Instead of returning the value from confirm, use it in an if statement to open a new window.----------------thank you,but I know nothing about javascripts...would you be so kind to write the if statement for me ?thank youregardsgabriele Link to comment Share on other sites More sharing options...
justsomeguy Posted November 2, 2010 Share Posted November 2, 2010 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; Link to comment Share on other sites More sharing options...
gabrielebr Posted November 2, 2010 Author Share Posted November 2, 2010 Maybeonclick="confirm('Are you sure you want to view this page?'); window.open(this.href);"---------------------thank you,it seems it doesn't work: it opens twice the link, once in a new window and once replacing the current window.gabriele Link to comment Share on other sites More sharing options...
gabrielebr Posted November 2, 2010 Author Share Posted November 2, 2010 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 More sharing options...
ShadowMage Posted November 2, 2010 Share Posted November 2, 2010 I know I should learn javaJust so you're clear, Java and JavaScript are entirely different languages. Link to comment Share on other sites More sharing options...
Synook Posted November 3, 2010 Share Posted November 3, 2010 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 More sharing options...
gabrielebr Posted November 3, 2010 Author Share Posted November 3, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.