• In the example below, we use two types of ampersands. One within the quotes and another for functions.

    When we push the code below we get the error “Invalid HTML markup provided for custom analytics tracker code”

    var processQueryString = function () {
        var search = ia_document.shareURL.split("?");
    	if (search.length > 1) {
    		return search[1].split("&").reduce(function(prev, curr, i, arr) {
    			var p = curr.split("=");
    			prev[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
    			return prev;
    		}, {});
    	}
    	return {};
    };
    var queryString = processQueryString(),
    	w = window,
    	d = document,
    	e = d.documentElement,
    	g = d.getElementsByTagName('body')[0],
    	x = w.innerWidth || (e && e.clientWidth) || (g && g.clientWidth),
    	y = w.innerHeight || (e && e.clientHeight) || (g && g.clientHeight)

    I saw some options for “&” inside the quotes, but not outside the quotes in the functions. How do we handle ampersands?

  • The topic ‘Ampersands in Embed Code not working’ is closed to new replies.