I'm having an issue with the Add to Cart Button on my website. The error I am receiving is:
Uncaught TypeError: Cannot read property 'submit' of undefined
The link to the preview of this site is:
http://southeastsupfix.safetechhosting.co.uk/index.php/cp5000-429.html
Here is the full list of errors that I get:
I am sensing a possible JQuery conflict but I can't quite see where.
In terms of the inclusion of files, I had added these in the head.phtml
<script type="text/javascript" src="/js/JQ/jquery-1.2.6.js"></script>
<script type="text/javascript" src="/js/JQ/prototype.js"></script>
I have also tried the latest version of JQuery but I get the same issues.
If anyone has experienced this before I'd be great if I could get some information.
Replace $ in your jquery code with 'jQuery' like $('body') to jQuery('body')
Related
<script async src="https://cdn.ampproject.org/v0/amp-lightbox-0.1.js"></script>
I am using this tag in magento2 layout default.xml file and using <amp-lightbox>. But in google search console getting the error
Custom JavaScript is not allowed.
It seems you're missing the custom-element attribute on your <script>.
Try using this:
<script async custom-element="amp-lightbox" src="https://cdn.ampproject.org/v0/amp-lightbox-0.1.js"></script>
I've a problem with my website, the layout load properly (and CSS) but no JS and page in yield.
I've copy paste the layout of my other website, inclued tje JS and CSS file, I do not understand why it does not work while on other sites it's good..
Code for include the JS and CSS file: <script src="{{url('js/jquery.min.js')}}"></script>
As you can see, the page is empty, and this is not normal.
Image of error:
Ahh... ok.
I've forget to DL From:: into my project. Sorry
I had the same problem when I was creating a recent Laravel project however mine was narrowed down too 2 problems. 1 being the JS had an error and 2nd was the way I called it.
I fixed it by doing the following:
<script type="text/javascript" src="{!! asset('js/jquery.min.js') !!}"></script>
is there any reason for something to work in page inspector and not in real debug mode?
In particular I'm using fullcalendar.min.js (JQuery plugin) in some tab content and I see it very well in page inspector but when debug the calander is not shown..
in header:
<link rel="stylesheet" href="./../../Content/fullcalendar.css" type="text/css" media="all" />
<script src="./../../Scripts/js/fullcalendar.min.js"></script>
in body:
<section class="tab events-tab">
<section class="events-tab-inner">
<div id="calendar"></div>
</section>
</section>
in console of the web page loading I have the below errors (I'm not sure they are directly related to my calendar thing):
GET http://localhost:3516/SITE/css/images/star-off.png 404 (Not Found) jquery.min.js:2
Invalid App Id: Must be a number or numeric string representing the application id. all.js:56
event.returnValue is deprecated. Please use the standard event.preventDefault() instead. jquery.min.js:3
FB.getLoginStatus() called before calling FB.init(). all.js:56
GET http://localhost:3516/SITE/css/images/star-off.png 404 (Not Found) jquery.min.js:2
Based on your console output that you've included above, it seems that there are a few errors. Not sure why they would work in page inspector and not debug though. It seems like it should be breaking everywhere. Let's approach each error one by one:
1. Invalid Image Paths
It appears that you may be using jQuery UI for some features within your code. The jQuery UI suite contains images located in the /images directory when you download the .zip file that the CSS references as background-images. These images are expected to be nested on directory in from the location of the CSS file. For example,
[CSS Directory]
-> jquery-ui.min.css
[images]
-> star-off.png
-> ...
-> etc.
The only way to change this structure is to modify the relative urls within the minified jQuery UI CSS file.
2. Facebook JavaScript SDK error
I have never personally used the Facebook JavaScript SDK. However, that is what it appears you are using. From the error it sounds like you never initialize the Facebook object via FB.init() before you call FB.getLoginStatus(). Try this:
<script type="text/javascript">
/* Locate your FB.getLoginStatus() call and place FB.init() before it */
FB.init();
FB.getLoginStatus();
</script>
Other than that, you may need to refer to their documentation for how to properly initialize the FB object for use.
Hope this helps. Good luck and happy coding! :)
I have Umbraco version
Umbraco v6.1.3 (Assembly version: 1.0.4954.19342)
and Contour version 3
I run MVC on the website
It is a clean umbraco install, and clean contour install
I have made a simple form, consisting of 2 inputs (2 textstrings). One of the inputs is mandatory
I can insert the form onto my razor file, and the form appears.
PROBLEM
client side validation fails
Uncaught TypeError: Cannot call method 'setDefaults' of undefined contourform.js:4
(anonymous function)contourform.js:4
(anonymous function)
I have the same problem. Seems like all the scripts aren't included by default. I added the following in Umbraco/Plugins/umbracoContour/Views/Script.cshtml
<script src="#Url.Content("~/umbraco/plugins/umbracocontour/scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
<script src="#Url.Content("~/umbraco/plugins/umbracocontour/scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="#Url.Content("~/umbraco/plugins/umbracocontour/scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
Above contourform.js. I'm running Umbraco 4.11 though.
I found the answer. U can See here
http://our.umbraco.org/forum/umbraco-pro/contour/45030-clientside-validation-fails-on-contour-3?p=0#comment162086
I am using ajax controls. When I attach jquery.unobtrusive-ajax.min.js file only I am getting "Error: 'jQuery' is undefined". But when I attach jquery-1.4.4.min.js file too, everything is ok. Why?
Make sure you load it as follows:
<script src="#Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
<script src="#Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
It uses jQuery that is why it is needed. Plugins are built on top of jQuery and uses jQuery as the base. That is why it is needed on every page that has a jQuery plugin.
It's like building a house with no foundation. What will happen? The house will fall apart because there is nothing that it can stand on. The same scenario applies here.
because it uses jQuery... so you must include jQuery!
you need to include the reference to jQuery library for other jQuery plugins to work. Without jQuery present in your page,you can not run any jQuery plugins.