PageSourceSearch

https://www.midaspattern.co.uk/scripts/seoImages.js

js midaspattern.co.uk collected 2026-09-25 09:49:42 UTC 1,394 bytes, 39 lines download raw bytes

1
2
3var handlerLocation = "/handlers/SEOImages.ashx";
4
5//alt tag replacement service
6$(document).ready(function () {
7    var imgArr = "";
8    $("img").each(function () {
9        var src = $(this).attr("src");
10        if (src.indexOf("?") !== -1)
11            src = src.substring(0, src.indexOf("?"));
12        if (src && src.indexOf("http") == -1) imgArr += src + ",";
13    });
14
15    if (imgArr.length > 0) {
16        imgArr = imgArr.substring(0, imgArr.length - 1);
17
18        $.ajax({
19            type: "POST",
20            url: handlerLocation,
21            data: { 'xdata': imgArr },
22            contentType: "application/x-www-form-urlencoded; charset=UTF-8",
23            dataType: "text",
24            success: function (response) {
25                if (!response)
26                    return;
27                var result = JSON.parse(response);
28                $(result).each(function () {
29                    var tags = JSON.parse(JSON.stringify(this.seotags));
30                    $(tags).each(function () {
31                        $("img[src^='" + this.url + "']").attr("title", this.title);
32                        $("img[src^='" + this.url + "']").attr("alt", this.alt);
33                        $("img[src^='" + this.url + "']").parents(".img-wrap").attr("title", this.title);
34                    });
35                });
36            }
37        });
38    }
39});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.