Jquery mask is undefined - javascript

I am using the mask plugin into my project. I have included it like this;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.10/jquery.mask.js"></script>
Even though I am able to use the mask method like this and it works without a problem;
$("#txtTel").mask("+380 999 999 999")
I am not able to use it to change its definitios like this;
$.mask.definitions['9'] = '';
$.mask.definitions['#'] = '[0-9]';
It gives me this error;
Uncaught TypeError: Cannot read property 'definitions' of undefined
What can be causing this problem? Thanks in advance...

You're using one plugin with the documentation from another.
The syntax you're using applies to this plugin:
https://www.npmjs.com/package/jquery.maskedinput
... not to the one you're using.

Related

TypeError: $(...).countdown is not a function

I have got this line in my code at website
http://talentbridge.pl/webinar/landingRB.php
$(document).ready(function() {
$("#timeleft").countdown("2016/05/06");});
and it is giving me this error:
TypeError: $(...).countdown is not a function
$("#timeleft").countdown("2016/05/06");
Please let me know how to fix this problem. Thanks.
You are using the source from countdownjs.org, but nowhere there it is stated that this is a jQuery-plugin which can be used with $().countdown(). See their demo-page for an example of the usage.
Furthermore I would recommend not to use a github-url as a CDN for your javascript sources.
I'm assuming $ here refers to jQuery . jQuery doesn't have anything called countdown . Probably someone in your team defined a prototype function , by extending jquery
Like as shown:
$.prototype.countdown = function(){alert(1)};
$('head'). countdown();
You need to re-define it , or check the commit list .

react-highcharts: Cannot set property 'HighchartsAdapter' of undefined

Trying to run next example http://kirjs.github.io/react-highcharts
Stuck with line:
global.HighchartsAdapter = require('exports?HighchartsAdapter!highcharts-standalone-adapter');
Without it, get error
Uncaught TypeError: Cannot set property 'HighchartsAdapter' of undefined
With it, obviously get
Cannot find module 'exports?HighchartsAdapter!highcharts-standalone-adapter'
So, the real question is how to include HighchartsAdapter.
P.S. The title of this question is different because it was my original google request. And I am not alone https://github.com/kirjs/react-highcharts/search?q=Cannot+set+property+%27HighchartsAdapter%27+of+undefined&type=Issues&utf8=%E2%9C%93
The original example should be bundled using webpack. Then I suppose it works fine.
If you want to use Browserify, then instead of using:
global.HighchartsAdapter = require('exports?HighchartsAdapter!highcharts-standalone-adapter');
var Highcharts = require("highcharts");
use next:
var Highcharts = require('highcharts-browserify');

Error with jQuery Session

I'm hoping someone can help me as I'm trying to store relatively simple values into a session with jQuery (values from a select field). I've been trying to use this plugin here, but it is throwing an error on the page load. The error is as follows...:
Uncaught TypeError: Object function each(iterator, context) {
try {
this._each(iterator, context);
} catch (e) {
if (e != $break) throw e;
}
return this;
} has no method 'split'
I've read that this could be a conflict with Prototype so I added the following to the top of the jquery.session.js file and changed all instances of '$' to 'jQuery' to no avail.
jQuery.noConflict();
I'm not entirely set on this plugin and would be willing to use a different one if suggested to do so. I'm just hoping it is a quick fix someone is familiar with, or suggestions for another possible solution.
Thanks!
Here's a site that explains the html5 session storage.
http://www.nczonline.net/blog/2009/07/21/introduction-to-sessionstorage/

cusel.js Uncaught TypeError: Cannot use 'in' operator to search for 'using' in #<error>

I try to use cusel.js (styled selects) library on my selects, but It's does not work - selects are changing, but when I try to scroll over select options using jscrollpane, which is used for scrolling by Cusel, in JavaScript console I see unknown to me error:
Uncaught TypeError: Cannot use 'in' operator to search for 'using'
in #<error> (file jquery.js, line 9217).
My versions of libraries:
Jquery v1.7.2
cusel version 2.5
jquery.jscrollpane.js - tried all versions of this library, still does not work.
jquery.mousewheel.js - tried all possible versions, still does not work.
There is my code of calling cuSel:
jQuery(document).ready(function(){
var params = {
changedEl: ".lineForm select",
visRows:7,
}
cuSel(params);
});
Any thoughts?
You may substitute code of cusel plugin from here
here bug was fixed and plugin was adapted to jquery v1.7+

"Uncaught TypeError: undefined is not a function" JavaScript error using noobslider and mootools

I'm new to Javascript and have been attempting to use a Slider called noobSlide (mootools) but, after one success with it, have found it broken on my second attempt.
The error that I'm getting reads "Uncaught TypeError: undefined is not a function" in reference to this line of code:
var thumbsFx = new Fx.Style(thumbs_mask7,'left',fxOptions7);
I've included all of the necessary libraries for Mootools and the Slider scripts in the head of my pages, and have combed the HTML, but can't find a solution. It seems to be pointing me to the Mootools library but I know that isn't right since, as I said, I've already succeeded with it once using another example.
If it helps, here is the page housing all of the samples of the Slider (I'm trying to use #7 and have already used #3).
http://www.efectorelativo.net/laboratory/noobSlide/
If anyone can see where the source of the problem may be, I would really appreciate your eyes :)
Thanks,
Juliana
<script type="text/javascript">
window.addEvent('domready',function(){
//SAMPLE 7
var startItem = 0; //or 0 or any
var thumbs_mask7 = $('thumbs_mask7').setStyle('left',(startItem*60-568)+'px').setOpacity(0.8);
var fxOptions7 = {duration:1000, transition:Fx.Transitions.Back.easeOut, wait:false};
var thumbsFx = new Fx.Style(thumbs_mask7,'left',fxOptions7);
var hs7 = new noobSlide({
box: $('box7'),
items: [0,1,2,3,4,5,6,7],
handles: $ES('span','thumbs_handles7'),
fxOptions: fxOptions7,
onWalk: function(currentItem){
thumbsFx.start(currentItem*60-568);
},
startItem: startItem
});
hs7.walk(0);
});
</script>
why you don't use
$ES('span','thumbs_handles7')
as in their example?
$$('#thumbs_handles7 span')
Is this fixing the error?
Note: You need to make sure that you have all the html tags and their related ids as you defined them in the javascript code

Categories