![]() |
Check to see if image is present
Hello. I'm brand new to coding & I'm struggling a bit. Excuse me if this is in the wrong section or if I don't make sense.
How do I check if a certain image is present in a webpage & display a message box if it is? e.g. If the webpage contains image.jpg then display a message box If the webpage doesn't contain image.jpg then refresh the page & check again The script needs to check another webpage, by the way, not the page the script is being run on. Thank you in advance. |
Quote:
|
Quote:
Thanks for replying. |
Oh...okay.
Code:
var images = document.getElementsByTagName("img"); |
I'm not too sure how I'd get it to work just from that.
Is it possible I can have 2 buttons, one that says start & one that says stop? When start's clicked, it keeps checking & refreshing until I click stop. It'd be good if the page was allowed to load completely before it checks & then maybe waits a second before refreshing (to prevent throttling). I hope I'm not being a pain. Like I said, I'm completely new. It'd be helpful if you could explain each line of code so that I can learn it better, too. Thank you. |
I don't know how Chrome plugins work. I assumed you knew that part.
I don't understand how you can add buttons to an existing web page just using the plugin. Does it somehow insert new stuff into the existing HTML??? Sorry. You'll have to figure that part out. Annotating my code: Code:
// get a collection of *ALL* <img> tags on the page |
If I understood correctly, Chrome lets you insert your javascript into a webpage you're on automatically or at the click of a button (the button being the extension itself so that when you click the extension, it inserts the code).
Here's the link: clicky click. |
Hmmm...I have a great use for this! Will have to experiment.
|
Quote:
|
| All times are GMT +1. The time now is 04:51 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.