Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q38 How can I have a conditional link that will work on all browsers?

irt.org | Knowledge Base | JavaScript | Link | Q38 [ previous next ]

Q38 How can I have a conditional link that will work on all browsers?

Try:

<script language="JavaScript"><!--
function query(url) {
  if (confirm("Do ya really wanna go?")) {
     location.href = url;
  }
  return false;
}
//--></script>

<a href="#" onClick="this.href='query(\'apage.htm\')'">go?</a>

Feedback on 'Q38 How can I have a conditional link that will work on all browsers?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 6th July 2009. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2009 irt.org, All Rights Reserved.