At the company where I work, we have numerous clients with their own websites that are connected to our system through a linking mechanism. Essentially, these clients have a link on their website that directs users to our site upon clicking.
I am working on implementing a tracking feature that requires the client to add a small block of code on their homepage. This code will request a file from my server whenever the homepage is loaded with a specific query string variable, allowing me to record tracking information based on the query string.
While it would be simple if all clients used jQuery or a similar library, I cannot assume that they do. Additionally, I want to keep the size of the JavaScript block minimal for ease of implementation.
I believe the ideal solution would involve something like:
if(querystring.substring("Tracking=") > 0)
{
include("blah.aspx?TrackingQS=" + querystring);
}
However, I have been unable to find an include
function in native JavaScript without incorporating a library like jQuery.
Any suggestions?? While I could go for a straightforward AJAX approach, I am aiming to reduce the number of lines of code for various reasons I won't delve into here.