shedokan Posted November 29, 2007 Share Posted November 29, 2007 I want to find if it's like http://images.neopets.com/neoboards/avatars/sb.gif and I get an error says there is no such function match... <script language="javascript" type="text/javascript"> <!-- function showImage(avatarImage){ if(avatarImage.match("\http:\/\/images\.neopets\.com\/neoboards\/avatars\/[a-zA-Z0-9_]+\.gif")){ var avatarImageS=avatarImage.split("."); avatarImageS=avatarImageS[2].split("/"); avatarImage=avatarImageS[3]; } document.getElementById("image").src="http://images.neopets.com/neoboards/avatars/"+avatarImage+".gif"; } //--> </script> <form action="process.php" method="POST"> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td></td> <td align="right"><img id="image" src="" alt=""></td> </tr> <tr> <td>avatarImage:</td> <td><input type="text" name="image" onkeyup="showImage(this.value)" maxlength="70" value="http://images.neopets.com/neoboards/avatars/sb.gif"></td> </tr> </table> </form> thanks. Quote Link to comment Share on other sites More sharing options...
emehrkay Posted November 29, 2007 Share Posted November 29, 2007 try test Quote Link to comment Share on other sites More sharing options...
shedokan Posted November 29, 2007 Author Share Posted November 29, 2007 it says avatarImage.test is not a function. Quote Link to comment Share on other sites More sharing options...
shedokan Posted November 29, 2007 Author Share Posted November 29, 2007 yay, here's what fixed it: var regExp = new RegExp("^(http:\/\/images\.neopets\.com\/neoboards\/avatars\/[a-zA-Z0-9_]+\.gif)"); if(regExp.test(avatarImage)){ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.