I am implementing google chrome extension. I have written the following code for the same.
var callback = document.getElementById('callback');
callback.addEventListener('click', function() {
datepicker({"readonly":true,"changeYear":true,"changeMonth":true,"dateFormat":"yy-mm-dd","numberOfMonths":3,"required":false});
});
but the above code is not working. if anyone know the right way, please suggest me.
As per Arjun's answer:
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
it didnt worked, so I down-graded the jquery-1.9.1.js to lower version and it worked like charm. So change your jquery min version, it will start working.
Degrade the jquery.min file to lower version and enjoy. Tested, its working successfully with 1.8 version :)
Related
When I use jQuery clix then ajax is not working after when I use jQuery latest version then jQuery clix not work.
<script src="{{asset('build/js/custom.min.js')}}"></script>
<script src="{{asset('js/jquery.dataTables.min.js')}}"></script>
<script src="{{asset('js/jquery-calx-sample-2.2.8.min.js')}}" type="text/javascript"></script>
j query calx actually not work latest jquery.min,js, if you use old less than 2 version that can do work. use this cdn i think solve your problem.
or if you face as like-enter code here jQuery tooltip and popover not load and work
you can try this jquery code:-
$('.hasTooltip').tooltip();
or say more details your actual problem.
been looking for and trying everything to get this to work but just cannot seem to get it to do so.
Had previous code from some years ago that included an older version of ckeditor. It works fine but wanted to get a newer version going on the site and downloaded the latest (4.5.9).
The older version included the files ckeditor_php4.php, ckeditor_php5.php and ckeditor.php while the newer version has the file ckeditor.js.
Using the sample code given I was able to get this to work with no issues as a straight HTML page but when trying to include it into my PHP code nothing displays?
<script src='lib/ckeditor-new/ckeditor.js'></script>
<form>
<textarea name='editor1' id='editor1' rows='10' cols='80'>
This is my textarea to be replaced with CKEditor.
</textarea>
<script>
CKEDITOR.replace( 'editor1' );
</script>
</form>
Anything I'm missing here? I've tried including the separate HTML file (that works) into the PHP code, dropping out of PHP and back in after the above code, etc. All to no avail.
Thanks!
Edit:
This seems to be working to load the new version in PHP... hope this helps someone in the future or maybe someone will point out a better solution? Thanks for the help!
$ckeditor = new CKEditor();
$ckeditor->basePath = 'lib/ckeditor-new/';
//$ckeditor->config['height'] = 100;
$ckeditor->editor('editor1');
Hi guys I have been trying to insert a tooltip but I dont know what I am doing wrong..
I am including all the necessary files
<script src="jquery-1.7.2.js"></script>
<script src="jquery.tipTip.js"></script>
<script src="jquery.tipTip.minified.js"></script>
and using this script in the page too
<script language="javascript">
$(function(){
$(".someClass").tipTip();
});
</script>
and this is how I implement it into html
Curabitur dolor eros
what am I doing wrong?
here is the jsfiddle I think
http://jsfiddle.net/jFqFG/
I believe the issue was related to including jQuery twice; once before the plugin was referenced, then once thereafter, thereby nuking the plugin when jQuery was re-initialized.
Removing the second reference to jQuery evidently resolved the issue, as discovered in the comments attached to the question.
There apparently seems to be some kind of a bug when including both jQuery and tiptip files. There is a link here which discusses the same and provides a patch to overcome the same.
I have not tested it . Those who can , please do and provide the results.
My page, that contains a couple of slides functioned perfectly with just js/jquery-1.5.2.min.js.
I recently introduced a top banner to my webpage (www.ug-mart.com) with googles CDN , but the top banner didnt work. I have had to remove js/jquery-1.5.2.min.js for the top banner to work.
Having removed js/jquery-1.5.2.min.js everything that initially worked well now doesn't work. Only the top banner works. It seems like i cant have both and js/jquery-1.5.2.min.js on the same page.
Is there a way to stop the the two jquery libraries from conflicting, and collaborate?
Looking forward to your reply.
SirBT
you can safely use jQuery along with other libraries using .noConflict(). usually, it's a conflict of the use of the $ function name.
i prefer doing jquery in the "closure" method:
(function($){
//i can use "$" safely in here
}(jQuery));
also, if you are using multiple versions of jQuery, then don't. just download the latest and use it. it should still cater some of the old API.
heres a sample code to show how this works:
//lets hijack the "$"
$ = (function() {
return {
libName: "some other library using $"
}
}());
//create a closure for us to use "$"
(function($) {
//we can now use the $ safely in this closure
$('body').text('hello world! in the body!');
//let's check "$" in here
console.log('in here, "$" is jQuery:',$);
}(jQuery));
//let's check "$" out here
console.log('out here, "$" is:', $);
See jQuery's $.noConflict()
Although, you'd really be better off, reestablishing whatever plugin requires older jQuery and make use of new version only.
Does $.noConflict() works?
Import the js/jquery-1.5.2.min.js first and use $.noConflict() to register js/jquery-1.5.2.min.js. Then use another code block and import another version of jQuery. In the end, rewrite the top banner using jQuery.xxx() instead of $.xxx()
I think this should be work.
Replace any one of them as specified:-
Declare in any one of them
$a = jQuery.noConflict();
Replace all $ of that file by $a in that file
the simple answer.
add this at the end of your scripts.
<script src=""></script>
<script src=""></script>
<script type="text/javascript">
$.noConflict(true);
</script>
I've set document.ready in the middle of a page.
It was working fine on local server, on an online production beta server, but failed on the final server.
Any suggestions?
thx
Code:
$(document).ready(function() {
And yes. JQuery is loading and it's working propely
UPDATE: These days I've found the same issue and for futher reference the script tag that includes the jQuery must be propely closed. If not the $(document).ready() is never called.
Wrong:
<script type='text/javascript' src='js/jquery-1.6.2.min.js'/>
Also wrong:
<script type='text/javascript' src='js/jquery-1.6.2.min.js'>
Right:
<script type='text/javascript' src='js/jquery-1.6.2.min.js'></script>
Nowadays using hmtl5 <!DOCTYPE html>
Get Firebug and check:
is jQuery loading or is it missing. And is it loaded before the document.ready ?
is the script throwing any JavaScript-errors?
The most likely problem is the production server doesn't have a copy of jquery. Switching to having google provide jquery for you is a good practice.