Jquery date picker error for islamic calender - javascript

I am getting javascript runtime error: Unable to get property 'regional' of undefined or null reference.
<head runat="server">
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="Scripts/jquery.calendars.js"></script>
<script type="text/javascript" src="Scripts/jquery.calendars.plus.js"></script>
<script type="text/javascript" src="Scripts/jquery.calendars.picker.lang.js"></script>
<script type="text/javascript" src="Scripts/jquery.calendars.picker.lang.js"></script>
<script type="text/javascript" src="Scripts/jquery.calendars.picker-ar.js"></script>
<script type="text/javascript">
$(function ()
{
$('#TextBox1').calendars.picker($.extend( { calendar: $.calendars.instance('arabic', 'ar-EG') }, $.calendars.picker.regional['ar-EG'] ));
});
</script>

You need to download jquery lib for islamic calendar .
jquery.calendars.islamic.min.js
then use it like this:
$('#TextBox1').calendarsPicker({ calendar: $.calendars.instance('islamic') });

Related

Multiple Versions of jQuery, linking with google no help and neither is noConflict

I need to have a jquery countdown, carousal and responsive menu on my site, but can't get all of them to work together.. I have tried using the google libraries but then one, two or all of the scripts stop working all together.
Here is the code without the noconflict as it was not working...
<script type="text/javascript" src="/Includes/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/Includes/jquery.jcarousel.min.js"> </script>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#mycarousel').jcarousel();
});
</script>
<script type="text/javascript" src="/Includes/Resp_Menu_Files/js/jquery-1.10.1.min.js"> </script>
<script type="text/javascript" src="/Includes/Resp_Menu_Files/js/orion-menu.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery().orion({
speed: 500
});
});
</script>
Any suggestions?
<script type="text/javascript" src="/Includes/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/Includes/jquery.jcarousel.min.js"> </script>
<script type="text/javascript">
jq142 = jQuery.noConflict(true);
</script>
<script type="text/javascript" src="/Includes/Resp_Menu_Files/js/jquery-1.10.1.min.js"> </script>
<script type="text/javascript" src="/Includes/Resp_Menu_Files/js/orion-menu.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
jq142('#mycarousel').jcarousel();
jQuery().orion({
speed: 500
});
});
</script>

ReferenceError: moment is not defined

I'm trying to use Ultimate date plugins for DataTables (http://datatables.net/blog/2014-12-18). I have both file (moment.js 2.8.1 and datetime-moment.js plugin), they are load fine but when I use the syntax :
$(document).ready(function() {
$.fn.dataTable.moment( 'DD/MM/YYYY' );
$('#example').DataTable();
} );
I got an error : ReferenceError: moment is not defined
Don't know where is the problem...
Edit :
<script src="/js/libs/jquery/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="/js/libs/jquery-ui/jquery-ui-1.11.1.min.js" type="text/javascript"></script>
<script src="/js/libs/validationEngine/js/languages/jquery.validationEngine-fr.js" type="text/javascript"></script>
<script src="/js/libs/validationEngine/js/jquery.validationEngine.js" type="text/javascript"></script>
<script src="/js/libs/underscore/underscore-1.7.0.min.js" type="text/javascript"></script>
<script src="/js/libs/moment/moment-2.8.1.min.js" type="text/javascript"></script>
<script src="/js/plugins/datatables/js/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="/js/plugins/datatables/js/datetime-moment.js" type="text/javascript"></script>
<script src="/js/libs/highcharts/4.0.4/highcharts.js" type="text/javascript"></script>
<script src="/js/libs/highcharts/4.0.4/highcharts-more.js" type="text/javascript"></script>
<script src="/js/libs/highcharts/4.0.4/modules/exporting.js" type="text/javascript"></script>
<script src="/js/libs/highcharts/4.0.4/modules/no-data-to-display.js" type="text/javascript"></script>

How to use jQuery UI datepicker.format

The following results in: Uncaught TypeError: Cannot read property 'formatDate' of undefined
I have all three files in the same directory (jquery, jquery-ui and this html file):
<html>
<head>
<link rel="stylesheet" href="jquery-ui.min.css">
<script src="jquery-1.11.1.min.js"</script>
<script src="jquery-ui.min.js"</script>
<script>
$(document).ready(function(){
var $t = $.datepicker.formatDate("M dd", new Date("2014-12-01"));
console.log($t);
});
</script>
</head>
<body>
</body>
</html>
What am I doing wrong?
If this is your actual HTML, you should change
<script src="jquery-1.11.1.min.js"</script>
<script src="jquery-ui.min.js"</script>
into
<script src="jquery-1.11.1.min.js"></script>
<script src="jquery-ui.min.js"></script>
You aren't loading the jquery-ui properly. You need a closing bracket.
HTML:
<input type="text" id="your_input" name="your_input" />
JS:
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<script>
$(function() {
$( "#your_input" ).datepicker();
});
</script>
Optional Fast load datapicker:
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<script>
$(function() {
$('body').on('focus',"#your_input", function(){
$(this).datepicker({ dateFormat: 'dd-mm-yy' });
});
});
</script>
I sloved the same error by using the FULL datepicker js file
<script src="/js/jquery.datetimepicker.full.js"></script>
available in
Git Datetimepicker/build/

My time picker is not working

hi friends my time picker is not working please some one help me
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"> </script>
<script type="text/javascript" src="../src/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('.time').each(function () {
$('.time').timepicker({
hourGrid: 4,
minuteGrid: 10,
timeFormat: 'hh:mm tt'
});
});
});
You need to add timepicker library in your html
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.1/jquery-ui.js">
</script>
<!-- Add this script tag -->
<script type="text/javascript" src="[timepicker_LOCATION]/jquery-ui-timepicker-addon.js">
</script>
https://github.com/trentrichardson/jQuery-Timepicker-Addon
Note: Also there is no need to loop through to each .time class
Remove the loop
$('.time').each(function ()

New popup does not point to javascript links and libraries

I use this function to open a new window using the htmlMarkup as html content.
function PC_DownloadAsPdfSuccess(htmlMarkup) {
$("div#rightcolumnFARP").detachLoader();
if (htmlMarkup != null && htmlMarkup.length != 0) {
var printWindow = window.open("", "");
var newDocument = printWindow.document;
newDocument.open();
newDocument.write(htmlMarkup);
newDocument.close();
}
}
The new page is working as expected, except that is does not recognise the include js libraries, such as jquery, MicrosoftMvcAjax.js, etc. I get all sorts of error like:
$ is not defined, jquery is not defined, xVal is not defined. I'm pretty sure it's because the path for the links in the new window do not point correctly to the scripts, but only in IE. Firefox does not have this issue.
Here is the head htmlMarkup that seems to be the problem. I've tried playing with the path by going up several levels (using ../) but still no luck.
<head id="Head1"><title>
Print preview
</title>
<script src="/Scripts/jquery-1.6.1.min.js" type="text/javascript"></script>
<link href="/Content/ui.base.css" rel="stylesheet" type="text/css"
media="screen" />
<script src="/Scripts/utils.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
<script src="/Scripts/jquery-1.6.1.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-ui-1.8.1.custom.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery.preloadImages.js" type="text/javascript"></script>
<script src="/Scripts/grid.locale-en.js" type="text/javascript"></script>
<script src="/Scripts/grid.base.js" type="text/javascript"></script>
<script src="/Scripts/grid.formedit.js" type="text/javascript"></script>
<script src="/Scripts/jquery.tablednd_0_5.js" type="text/javascript"></script>
<script src="/Scripts/xVal.jquery.validate.js" type="text/javascript"></script>
<script src="/Scripts/jquery.validate/jquery.validate.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-html-encode-decode.js" type="text/javascript"></script>
<script src="/Scripts/jquery-timedLogout.js" type="text/javascript"></script>
<script src="/Scripts/round-corners.js" type="text/javascript"></script>
<script src="/Scripts/superfish.js" type="text/javascript"></script>
<script src="/Scripts/jquery.formatCurrency-1.3.0.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery.tipTip.js" type="text/javascript"></script>
<script src="/Scripts/easyslider.js" type="text/javascript"></script>
<script src="/Scripts/jquery.json.min.js" type="text/javascript"></script>
<script src="/Scripts/browserSelector.js" type="text/javascript"></script>
<script src="/Scripts/jquery.antiForgeryToken.js" type="text/javascript"></script>
<script src="/Scripts/jquery.watermark.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery.autocomplete.js" type="text/javascript"></script>
<script src="/Scripts/jquery.calculation.js" type="text/javascript"></script>
<script src="/Scripts/DetectBrowser.js" type="text/javascript"></script>
<script src="/Scripts/jquery.infoblock.js" type="text/javascript"></script>
<script src="/Scripts/jquery.jloader.js" type="text/javascript"></script>
<script src="/Scripts/jqGridHeight.js" type="text/javascript"></script>
<script src="/Scripts/jquery.alerts.js" type="text/javascript"></script>
<script src="/Scripts/tabs.js" type="text/javascript"></script>
<script src="/Scripts/CustomValidation.js" type="text/javascript"></script>
<script src="/Scripts/fullcalendar.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript" src="/Scripts/jqplot/jquery.jqplot.min.js"></script>
<script language="javascript" type="text/javascript" src="/Scripts/jqplot/plugins/jqplot.pieRenderer.js"></script>
<script language="javascript" type="text/javascript" src="/Scripts/jqplot/plugins/jqplot.barRenderer.js"></script>
<script language="javascript" type="text/javascript" src="/Scripts/jqplot/plugins/jqplot.categoryAxisRenderer.js"></script>
<script language="javascript" type="text/javascript" src="/Scripts/jqplot/plugins/jqplot.dateAxisRenderer.js"></script>
<script language="javascript" type="text/javascript" src="/Scripts/jqplot/plugins/jqplot.barRenderer.js"></script>
<script language="javascript" type="text/javascript" src="/Scripts/jqplot/plugins/jqplot.canvasAxisTickRenderer.js"></script>
<script language="javascript" type="text/javascript" src="/Scripts/jqplot/plugins/jqplot.canvasTextRenderer.js"></script>
<script language="javascript" type="text/javascript" src="/Scripts/jqplot/plugins/jqplot.highlighter.js"></script>
<script language="javascript" type="text/javascript" src="/Scripts/jqplot/excanvas.min.js"></script>
<head>
This is because u have already opened the window, which would have finished the loading event, after that u are placing the content, so the content is treated as text and the script functions are not loaded to your window you have opened. If suppose if have the javascript functions written openly on the window within script tag it would have worked, since the external script files are not got loaded, u are getting those errors, try some other way to fix ur problem

Categories

Resources