BillyBoB Posted April 11, 2008 Share Posted April 11, 2008 Hi, I have been working on this project for around a week now and I need to be able to search a string and see if it has an image in it. I have no idea where to start so any help will be greatly appreciated. Thanks in Advance, Cean Fritz Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted April 11, 2008 Share Posted April 11, 2008 Can you be more specific? Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted April 11, 2008 Author Share Posted April 11, 2008 Sure. Like the string is "<b><img src="blah" alt="bah" /></b>" I want to find if it has the <img tag and then get the height of it. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted April 11, 2008 Share Posted April 11, 2008 I suppose you could search for the string <img within your string. // Not tested var aString = "this contains an image <img src='myimg' /> in it"; if( aString.search( "<img" ) != -1 ){ alert("has image"); } I have a feeling that's not going to give you what you want. Are you trying to find a specific image within the page? Quote Link to comment Share on other sites More sharing options...
ess14 Posted April 14, 2008 Share Posted April 14, 2008 perhaps a regular expression would help, try look that up 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.