Check for JS on page

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
punkstjimmy
Posts: 1
Joined: Wed Jun 29, 2011 3:22 am
Location: UK

Check for JS on page

Post by punkstjimmy »

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?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Check for JS on page

Post by KS-Soft Europe »

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.
Sure, URL request and HTTP test can check page contents. If there is some java script, HostMonitor can check script text.
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 exectly test method do you use: "URL request" or "HTTP" ?
What is test Status "Bad", "Bad Contents", "Unknown host", ... e.t.c. ?
What protocol is used for your URL`s: HTTP or HTTPS ?
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?
Could you provide URL link to one of the tested pages ?
Post Reply