Magento add to cart doesnt work - javascript

Hello i have a problem with my add to cart button in my magento theme. i have changed all theme, but it doesnt work, please any can help me? i see in the console the error:
Uncaught TypeError: Cannot read property 'submit' of undefined gabinete-ice-2x24w-magg.html:220
onclick
but too appear error in my prototype.js im put here the file prototype.js, and here the live link http://masluz.panamerik.net/gabinete-ice-2x24w-magg.html i hope can help me guys thanks!
PROTOTYPE.JS LINK:
http://masluz.panamerik.net/js/prototype/prototype.js
When i go to checkout page to place the order have error too with prototype.js whats happend with this?

You are callling two copies of jQuery, this will cause all sorts of issues with Magento.
<script type="text/javascript" src="http://masluz.panamerik.net/js/megamenu/jquery-1-7-2.js"></script>
<script type="text/javascript" src="http://masluz.panamerik.net/js/iwd/all/jquery-1.10.2.min.js"></script>

You are using multiple version of jquery (1.7.2, 1. 1.10.2 and lastly 1.3.2). Since the last loaded version is 1.3.2 it is very much outdated and will not support many functions.
Also, you are loading jquery.noconflict file before your last jquery include, hence the errors are most likely because of the conflict issues.
You can try removing all other version of jquery and load noconflict.js file at the end of all the scripts.

Related

Uncaught TypeError: $(...).carousel is not a function

I am using bootstrap to create a web app. I am using rails 4.2.2 and heroku as my server. At first the carousel works fine. But after visiting another link on my site when I come back to the home page, the carousel is not working. I get the error on the chrome console.
Uncaught TypeError: $(...).carousel is not a function
I have looked at other solutions given in the site, but nothing has worked for me so far.
I am using the following code to load the js and jquery in my .html.erb file
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
Any help is appreciated. Thank you.
I made sure I ran all the commands as mentioned in the following link:https://github.com/twbs/bootstrap-sass#a-ruby-on-rails Also, removed all the entries for adding bootstrap from my html files as they are not required here. Now the carousel is working even after coming back from the links. Only thing is on my chrome console, even now when everything seems to work fine, it is showing bootstrap is not defined. But everything seems to be working fine.

Uncaught TypeError: jQuery(...).fancybox is not a function |fancybox used in wordpress

I have a wordpress website and I want to show my video using fancybox, so I tried wp plugin like "fancybox for wordpress" and "easy fancybox".
But both of them give me the error message "Uncaught TypeError: jQuery(...).fancybox is not a function".
I search for many questions on here and found this can be jquery conflict, but I cannot figure out where is it.
here is my site http://skyblueenglish.co.uk
Notice that I only have one of above plugins at one time.
as per my thinking and till i have checked, what happen is,
in word-press you have included fancybox jQuery and it will obviously installed when you have installed the plugin. Now what happen is ,while using some JS function or JS Class it is mandatory to include jQuery file before we use/include the third party JS.
I checked the "View Source" for your page.
<script src="http://skyblueenglish.co.uk/wp-content/themes/skybluetheme/js/jquery.min.js"></script>
and i found that above JavaScript file is included in the footer.
i just removed that line and put it before
<script type='text/javascript' src='http://skyblueenglish.co.uk/wp-content/plugins/fancybox-for-wordpress/fancybox/jquery.fancybox.js?ver=1.3.4'></script>
and the error is Gone.
so what you have to do is, you have to find your footer, find the included jquery.min.js . remove it from the footer and include it from header.
Let me know if you dont understand anywhere.
;( function( $ ) {
$(document).ready(function(){
$(".fancybox").fancybox({
//....
});
});
} )( jQuery );
I did so many experiments on same topic and also tried with many different way to solve according to wherever I found similar topics on internet but trust me nothing worked out for me and then finally I simply tried to see what exactly error says:
Uncaught TypeError: $(...).fancybox is not a function
and for which I simply removed a line which was saying if($.fn.fancybox!==null).
I am not strong enough to understand Javascript or Jquery thing being fresher so I just tried with simple logic and it worked for me lol.
This might not be the right solution but just thought to share my experience so maybe for someone it may work too.
It worked properly without loosing any function by removing below code
if($.fn.fancybox!==null)
{$("a[class^='fancyBox']").fancybox();
$("a[class^='fancybox-thumb']").fancybox(
{helpers:{title:{type:'outside'},thumbs:{width:50,height:50}}});}
Thank You!

Javascript Conflicts in Console for Wordpress Plugin Global Gallery

I hope you can help me to debug my conflicts on the site I am working on:
URL: http://metalotechnika.com
PW: 12345678
If you then go to http://metalotechnika.com/foto-galeri/foto-kangjella-hekuri/
You will find a gallery that isn't loading. Most probably due to javascript conflicts. Could you pint me in the right direction here?
You will find some errors in the console: "TypeError: jQuery(...).lcweb_lazyload is not a function"
I thougt, that it must be jQuery not loading correctly. But I already tested jQuery in my main.js, and is working. Don't know about this time.
Ok, found the problem.
jQuery is loaded 2 times. And this is were the conflict came from. I just removed jQuery from my functions.php because Wordpress already loads it's own jQuery and throws conflicts if it is loaded a separate different time.
Thanks anyway.

edgePreload.js conflicting with jQuery.ScrollTo

I am using Edge animate for a header on my webpage. I am trying to incorporate the slide effect from page to page utilizing the jQuery.ScrollTo plugin courtesy of Ariel Flesler. The problem is that when I include the
<script type="text/javascript" charset="utf-8" src="spolightest_edgePreload.js"></script>
the slide effect stops working. I have narrowed it down to this file so I know that this is causing the problem. Any one ever deal with this problem? Does anyone know a better way to accomplish the slide effect in a webpage. It is quite a large amount of javascript to include here, so here is my site that I am trying to make this work on. You can view the script there.
www.premierentertainmentevents.com
I've tried to call the javascript files in different order, including the hosted jquery library from google, include the jqueryscroll.js in the edge preload file..
I'm at a loss. Something is conflicting with something else and I have no idea what.
Any ideas are greatly appreciated. Thank you
One thing I can see from your page is that the scripts include order isn't correct right now.
You are including jquery after the adobe edge's includes, so that in the console I can see the errors:
Uncaught ReferenceError: jQuery is not defined /spolightest_edge.js:2
Uncaught ReferenceError: jQuery is not defined spolightest_edgeActions.js:8
I know you tried different things, but please include jquery above anything else so maybe I can see if other errors occur.

Issue with javascript/jquery code in wordpress

Hey guys out of no where I got this issue that came up on a wordpress site, no idea why. So let me tell you the issues:
Uncaught TypeError: Cannot read property 'msie' of undefined jquery.rating.pack.js:17 from jquery.rating.pack.js:17
Uncaught TypeError: Object [object Object] has no method 'live' from jquery.colorbox-min.js:4
So I have 2 plugins that stopped working because of this. I don't know if there was an update of some sort or where to even begin.
If you could give me a hand I would appreciate it.
Let me know if you need anything!
EDIT:
prodjsoundlighting.com - link to site with issue.
You have two jQuery scripts included on your website, you need to remove the one that is not from wordpress.
/wp-includes/js/jquery/jquery.js?ver=1.8.3
http://code.jquery.com/jquery-latest.min.js
What happens is all jQuery extensions (colorbox, rating pack) attach themselves on jquery object from first jquery script, then the second jquery script overwrites jquery object and you can't access any of the previously attached jquery extensions.
EDIT:
To avoid "$ is not a function" errors you will need to either replace all $ to jQuery
$(document).ready(function(){
will become
jQuery(document).ready(function(){
OR whats usually used, encapsulate your code with anonymous function like this:
(function($) {
// here goes your javascript code where you access jquery object will dollar sign
})(jQuery);
P.S. There is one quick fix you could use until you fix your code. Just use this in the same place where you had that other jquery call:
<script>var $ = jQuery;</script>
You should update to the latest version of Colorbox. Grab it here.
Old versions of Colorbox relied on .live(), which is a deprecated function (from 1.7+) and removed completely from jQuery 1.9+.

Categories

Resources