Is it possible to check that a peice of javascript is present on a page? I am trying to set up a test to make sure that Google Analytics is running on a number of websites.
The script is in the head section of the page but I can't seem to get it to return as alive when i run a content test. I have tried using the full <script src="blahblah"></script> as well as using just src="blahblah".
I don't want to run or test the script, I just want to test if it's on the page. Can I do this with Host Monitor?
Check for JS on page
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
Check for JS on page
Sure, URL request and HTTP test can check page contents. If there is some java script, HostMonitor can check script text.Is it possible to check that a peice of javascript is present on a page? I am trying to set up a test to make sure that Google Analytics is running on a number of websites.
What exectly test method do you use: "URL request" or "HTTP" ?The script is in the head section of the page but I can't seem to get it to return as alive when i run a content test. I have tried using the full <script src="blahblah"></script> as well as using just src="blahblah".
What is test Status "Bad", "Bad Contents", "Unknown host", ... e.t.c. ?
What protocol is used for your URL`s: HTTP or HTTPS ?
Could you provide URL link to one of the tested pages ?I don't want to run or test the script, I just want to test if it's on the page. Can I do this with Host Monitor?