By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,932 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,932 IT Pros & Developers. It's quick & easy.

goto commend

P: 2
<script language="JavaScript1.2">


Expand|Select|Wrap|Line Numbers
  1. var testresults
  2. function checkemail(){
  3. var str=document.validation.email.value
  4. var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
  5. if (filter.test(str))
  6. testresults=true
  7. else{
  8. alert("Please input a valid email address!")
  9. testresults=false
  10. }
  11. return (testresults)
  12. }
  13. </script>
  14.  
  15. <script>
  16. function checkbae(){
  17. if (document.layers||document.getElementById||document.all)
  18. return checkemail()
  19. else
  20. return true
  21. }
  22. </script>
  23.  
i have this script
what the command must use
to the the next:
if testresults=true goto www.google.com
else goto www.yahoo.com
please any one can do it for me
[removed email]
Sep 10 '08 #1
Share this Question
Share on Google+
4 Replies


acoder
Expert Mod 15k+
P: 16,027
Set location.href:
Expand|Select|Wrap|Line Numbers
  1. location.href = "http://www.google.com/";
PS. please use code tags when posting code and do not post your email address. Please read the posting guidelines. Thanks.
Sep 10 '08 #2

P: 2
Set location.href:
Expand|Select|Wrap|Line Numbers
  1. location.href = "http://www.google.com/";
PS. please use code tags when posting code and do not post your email address. Please read the posting guidelines. Thanks.
thx thx thx thx
so easy so gd
Sep 10 '08 #3

Markus
Expert 5K+
P: 6,050
Also: the 'language' attribute is deprecated; use 'type="text/javascript"'
Sep 10 '08 #4

acoder
Expert Mod 15k+
P: 16,027
There's also the use of document.layers which is not required unless you're trying to support a browser over 10 years old (Netscape 4).

If you're new to JavaScript, check out the tutorial links in the Offsite Links sticky thread to get you started on your JavaScript journey.
Sep 11 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.