This error occurs because of a custom script we had running on the homepage. It had nothing to do with any of the 7 Spikes plugins. This thread can be closed. Thanks for your advice.
Thanks your your reply. Unfortunately I can do neither because our license has expired to submit a ticket, and the site in question is currently not public facing. We do have some custom code on the website. It seems to me like the scripts aren't being loaded in the correct order. Can you advise me on how I could enforce the script load order?
The script file is AjaxCart.min.js
I'm working on a 4.0 site that has several of the Seven Spikes plugins installed. We have an error on the homepage coming from the Ajax Cart Plugin. This only seems to occur on the homepage itself, and the plugin is otherwise functional. This error is causing problems on the homepage. For example the flyout cart doesn't work because of it. I've tried re-installed all Seven Spikes plugins including the core, however that didn't make any difference. The error is as follows:
Uncaught TypeError: a(...).kendoWindow is not a function
at M (AjaxCart.min.js:formatted:433)
at HTMLDocument.<anonymous> (AjaxCart.min.js:formatted:524)
at c (jquery-1.10.2.min.js:4)
at Object.fireWith [as resolveWith] (jquery-1.10.2.min.js:4)
at Function.ready (jquery-1.10.2.min.js:4)
at HTMLDocument.q (jquery-1.10.2.min.js:4)
Code:
function M() {
var t = f()
, o = a(t);
if (o.length > 0) {
o.prepend('<div class="addProductToCartErrors"></div><div class="addProductVariantToCartErrors"></div><div class="miniProductDetailsView"></div><div class="productAddedToCartWindow"></div>');
var e = a(".miniProductDetailsView").kendoWindow({
draggable: !1,
resizable: !1,
modal: !0,
actions: ["Close"],
animation: !1,
visible: !1
}).data("kendoWindow");
e.wrapper.addClass("ajaxCart"),
a(document).on("click", ".k-overlay", function() {
e.close()
})
}
var r = a(".productAddedToCartWindow").kendoWindow({
draggable: !1,
resizable: !1,
modal: !0,
actions: ["Close"],
animation: !1,
visible: !1
}).data("kendoWindow");
r.wrapper.addClass("ajaxCart"),
a(document).on("click", ".k-overlay", function() {
r.close()
})
}
Yes this has been solved. The conflict was occurring because of a script we were using for validation.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
Got rid of the script, and everything is fine now.
Thanks for your help.
It seems to be an order of operations issue where inside a plugin, the page is loaded first then the scripts. It needs to be the other way around.
I added these two lines above the other includes....
Html.AddScriptParts("~/Scripts/jquery-1.7.1.min.js");
Html.AddScriptParts("~/Scripts/jquery-ui-1.10.0.min.js");
It didn't seem to help at all.
I have the Instant Search plugin running on a 3.1 site. The problem I'm running into is all of my views pages from custom plugins cause the following javascript error with the instant search:
Uncaught TypeError: undefined is not a function
on Line:
var autocomplete = $("#small-searchterms").kendoAutoComplete(
My guess was that my plugin needed to reference the keno javascript libraries in Seven Spikes core. So I added this to my view page:
Html.AddScriptParts("~/Plugins/SevenSpikes.Core/Scripts/kendo.all.min.js");
Html.AddScriptParts("~/Plugins/SevenSpikes.Core/Scripts/kendo.public.min.js"); Html.AddScriptParts("~/Plugins/SevenSpikes.Core/Scripts/adminAnimatedCollapse.js");
Html.AddScriptParts("~/Plugins/SevenSpikes.Core/Scripts/animatedcollapse.js"); Html.AddScriptParts("~/Plugins/SevenSpikes.Core/Scripts/SevenSpikesExtensions.js");
Its loading those libraries however, it didn't fix the error, so I'm at a loss at this point.
Any ideas?
I need to modify several razor views in the views folder. I tried creating a "Views" folder under the default clean folder, then place my modified views in there. However when I rebuild, and fire up the site, its not displaying the modified view. What am I doing wrong?