Jump to content
 

RMweb locking up


Recommended Posts

  • RMweb Gold

The problem is this script failing to load from the ehattons server:

 

 

<script src="//test.ehattons.com/Scripts/HattonsPartnerScript.min.js"></script>

 

This script appears to provide a Search of the ehattons web site. Not sure where it fits on RMweb:

 

 

var hattonsUrl = "http://test.ehattons.com"; $(document).ready(function (a) { $("#txtHattonsMainSearch").keyup(function (b) { try { b.preventDefault(); b.stopPropagation() } catch (c) { } if (b.keyCode != 13) { mainSearch(b) } else { if ($("#txtHattonsMainSearch").val() == "" || $("#txtHattonsMainSearch").val() == "Search in stock & on order items") { alert("Please enter a search term.") } else { window.location = hattonsUrl + "/Zone/All-Items?SearchTerm=" + $("#txtHattonsMainSearch").val() } } }); $("#txtHattonsMainSearch").blur(function (b) { if (hattonsMainSearchItemSelected == false) { try { b.preventDefault(); b.stopPropagation() } catch (c) { } if ($("#HattonsMainSearchResults")) { $("#HattonsMainSearchResults").remove() } } }); $("#txtHattonsMainSearch").click(function (b) { try { b.preventDefault(); b.stopPropagation() } catch (c) { } mainSearch(b) }); $("#btnMainSearch").click(function (b) { if ($("#txtHattonsMainSearch").val() == "" || $("#txtHattonsMainSearch").val() == "Search in stock & on order items") { alert("Please enter a search term.") } else { window.location = hattonsUrl + "/Zone/All-Items?SearchTerm=" + $("#txtHattonsMainSearch").val() } }) }); var mainSearchURL = hattonsUrl + "/Component/PartnerMainSearch"; var hattonsMainSearchItemSelected = false; function mainSearch(a) { if ($("#HattonsMainSearchResults")) { $("#HattonsMainSearchResults").remove() } if ($("#txtHattonsMainSearch").val().length > 0) { } if (a.keyCode == 13) { } else { if ((a.keyCode == 46 || a.keyCode == 8) && $("#txtHattonsMainSearch").val().length == 0) { } else { if ($("#txtHattonsMainSearch").val().length > 0) { $.ajax({ global: false, type: "POST", data: { searchTerm: $("#txtHattonsMainSearch").val(), partner: "RMWeb" }, url: mainSearchURL, success: function (b) { mainSearchcomplete(b, $("#txtHattonsMainSearch").val()) }, error: function (c, e, d) { var b = "An error occured searching the Hattons Model Railways product catalogue."; alert(b) } }) } } } } function mainSearchcomplete(b, a) { if (b.length > 0) { var d = document.createElement("TABLE"); d.cellSpacing = 0; d.cellPadding = 1; d.style.backgroundcolor = "white"; d.id = "HattonsMainSearchResults"; d.className = "HattonsMainSearchResults"; d.zIndex = 1000; var f = document.createElement("TBODY"); d.appendChild(f); for (var e = 0; e < b.length; e++) { var c = b[e]; if (parseInt(c.StockID) > 0) { var h = c.ImageLocation; if (h == null || h.length == 0) { h = "http://www.ehattons.com/app_themes/default/images/NoImageAvailable_3up.gif" } else { h = "http://www.ehattons.com/images/products/45pxhigh/" + h } var g = ""; if (c.EbayListing == true) { g = '<tr><td><a href="http://www.ebay.co.uk/itm/' + c.EbayListingID + '" target="_blank" onmouseover="hattonsMainSearchItemSelected = true;" onmouseout="hattonsMainSearchItemSelected = false;"><img src=\'' + h + "' class='searchwithinImage'></a><br />" + c.StockStatus + '</td><td><a href="http://www.ebay.co.uk/itm/' + c.EbayListingID + '" target="_blank"  onmouseover="hattonsMainSearchItemSelected = true;" onmouseout="hattonsMainSearchItemSelected = false;"><strong>' + c.ProductCode + "</strong><br/> " + c.ProductTitle + " Ebay Auction</a></td></tr>" } else { g = '<tr><td><a href="' + c.ProductLink + '" target="_blank" onmouseover="hattonsMainSearchItemSelected = true;" onmouseout="hattonsMainSearchItemSelected = false;"><img src=\'' + h + "' class='searchwithinImage'></a><br />" + c.StockStatus + '</td><td><a href="' + c.ProductLink + '"  target="_blank" onmouseover="hattonsMainSearchItemSelected = true;" onmouseout="hattonsMainSearchItemSelected = false;"><strong>' + c.ProductCode + "</strong><br/> " + c.ProductTitle + " " + c.FormattedSellingPrice + "</a></td></tr>" } g += '<tr><td colspan="2" style="height:2px; border-bottom:2px solid grey;"></td></tr>'; $(f).append(g) } else { if (parseInt(c.StockID) == -1) { var g = "<tr><td colspan='2'><a href=\"" + c.ProductLink + '"  target="_blank" onmouseover="hattonsMainSearchItemSelected = true;" onclick="SearchMainShowMore(\'' + a + '\');" onmouseout="hattonsMainSearchItemSelected = false;">Show more products</a></td></tr>'; $(f).append(g) } else { var g = "<tr><td colspan='2'>No results found</td></tr>"; $(f).append(g) } } } d.style.position = "absolute"; d.style.top = $("#txtHattonsMainSearch").offset().top + document.getElementById("txtHattonsMainSearch").offsetHeight + "px"; d.style.left = $("#txtHattonsMainSearch").offset().left + "px"; if ($("#HattonsMainSearchResults")) { $("#HattonsMainSearchResults").remove() } document.body.appendChild(d) } else { if ($("#HattonsMainSearchResults")) { $("#HattonsMainSearchResults").remove() } } };
 

 

Martin.

Link to post
Share on other sites

It's a test for an ad feature, the script sent by the authors doesn't complete properly and is being referred back to them. We'd put the js lines back into the header late last week to try and iron out the fault but it's obviously causing an issue so I'll remove it again. This didn't cause the issues over the weekend, that's been isolated and will be monitored.

Link to post
Share on other sites

I have three times now, once each, Saturday, Sunday, today Monday, had a weirdery on this site. It locks for a few seconds, and then a torrent of US celeb gossip style pages largely relating to Kim Kardashian opens. I go regularly to any number of sites, not having trouble anywhere else: three occurences all on this site looks beyond coincidence.

 

It's only a nuisance, and easily halted once it starts, but it would be good if this is preventable.

Link to post
Share on other sites

I have three times now, once each, Saturday, Sunday, today Monday, had a weirdery on this site. It locks for a few seconds, and then a torrent of US celeb gossip style pages largely relating to Kim Kardashian opens. I go regularly to any number of sites, not having trouble anywhere else: three occurences all on this site looks beyond coincidence.

That's interesting Paul; thanks for flagging it up. It's not anything I've witnessed but it could relate to the attempts at disruption we've observed.

Link to post
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...