velocity is not a function materialize showing error in meteor - meteor

materialize.js:3503 Uncaught TypeError: $(...).find(...).css(...).velocity is not a function
(anonymous function) # materialize.js:3503
jQuery.event.dispatch # jquery.js:4665
elemData.handle # jquery.js:4333
error in console shows up when I click on card (materailize)

To solve this is used the jquery version that is located in the materialize folder
window.$ = window.jQuery = require('materialize-css/node_modules/jquery/dist/jquery.js');
require('materialize-css');

It's Becuase you may be including another version on jquery in you head tag. When you install materailize with meteor it also adds jquery as its dependency. Both versions are conflicting with each other. All you need to do is exclude that jquery script tag in your head tag.

The module materialize is incomplete.
I have created a solution for this problem, available on GitHub:
Create without webpack and velocity error : https://github.com/webpremium/angular2-materialize-cordova

Related

Meteor iron-router IRLibLoader loading external JS files but none of the DOM elements inside template are loading

I am using the meteor package IRLibLoader. It works great loading all of my external JS. I am able to call all of the JS functions from dev console to confirm that they are actually available. The problem... all of the DOM elements , for example div tags with id = foo.... I am unable to select any of them , they are all coming up undefined. The page is getting stuck to loading. Any ideas?
I ended up over complicating my issue.
The simple solution was for me to add the MyProject/public folder to my Meteor application.
For example:
MyProject/public/images/foo.jpg
I was then able to serve the content via the public folder and when any of my app needed access i would just put for example :

html/jade warnings when using i18n library with jade in a meteor project

I am using the following meteor template code in Jade to display a dropdown however I am receiving the following warnings.
Is this the correct way to implement the i18n internationalization package or is there an alternate accepted way to remove the warnings?
Assuming this is the correct implementation is there a way to either suppress the warnings or configure the parser to expect this as valid code?
# HTML version - header.html
<template name="i18nTest">
{{> i18n_dropdown}}
<div>{{_ "company"}}</div>
<div>{{_ "business"}}</div>
</template>
# Jade version - header.jade
template(name='i18nTestJade')
span
+i18n_dropdown
span
{{_ "company"}}
{{_ "business"}}
Warning: missing space before text for line 5 of jade file "client/layouts/i18nTest.jade"
Warning: missing space before text for line 6 of jade file "client/layouts/i18nTest.jade"
For clarification, I previously posted only the HTML version by mistake. I have now updated the example with the Jade version. Also, both versions are working however I get console warnings.

Can I set JQuery to work WITHOUT noConflict option in Wordpress?

I'm definitely NOT using another library for my WP installation and I'm loading lots of external js files that rely on the use of $. So I need to load jQuery WITHOUT the non-conflict mode.
I've seen 3 different ways:
a) deregistering present Jquery script and registering mine, (without the .noConflict() call in the last line)
b) using this code (but I can't add all my js files there)
(function($) {
$(function() {
// more code using $ as alias to jQuery
});
})(jQuery);
c) just assigning
$ = jQuery
I'm not sure what the pros and cons are (I guess b method only works for in-line code, not for adding my own jquery based js files which expect $ to be available)
Please advice!
a) make sure your 'own' version is compatible with wordpress.
c) make sure this statement is executed before including other jquery lib (the ones which expect $).
a and c) I won't do this for admin side

LightBox2 producing error

Site: http://www.onlinetestspace.com/project45/before-after
I have followed lightBox instructions http://leandrovieira.com/projects/jquery/lightbox/ and chrome is giving me the error:
Uncaught TypeError: Object # has no method 'lightBox'.
Can somebody please help me out?
I just investigate the things and i guess you are using old version of JQuery file (jQuery 1.2.3). Use the latest version of JQuery file and this will fix your problem.
The reason I was getting this error, was simply because of 2 conflicting files.

conflict between jquery-1.2.6.min.js and jquery-1.4.2

Hi all
i put jquery file in master page version jquery-1.4.2.min.js and in another page
jquery file jquery-1.2.6.min.js just in Firefox the jquery features don't work
JavaScript doesn't support class, function or whatever library.
You're just including jQuery twice - different versions -.
If you want to use both, you'd need to change jQuery prefix.
Version A: $
Version B : $$
Or any other valid prefix.
You can do so by changing jQuery object name to jQueryA and jQueryB, and at the end of jQuery source code, change the "$":
// Expose jQuery to the global object
window.jQueryA = window.$ = jQueryA;
...and:
// Expose jQuery to the global object
window.jQueryB = window.$$ = jQueryB;
It's not a good approach so far, but maybe your requirements are leaving an old version of jQuery for some tasks because you don't support some code, and you want to do some new feature with another and newer jQuery version...
What happens when you include jquery a second time, is that it forgets all customizations that has been made since the first include. So the solution is simple: Dont include it twice.

Resources