For some reason I'm having a hard time getting fullcalendar to work using the google api. The calendar displays but no events are showing. Google developer console is not showing any requests. I've generated my api key and my calendar is public (I've double check a thousand times!) Could someone please check this code and tell me what I'm doing wrong! Using Fullcalendar v2.3.2
<link rel="stylesheet" href="css/style.css">
<link rel='stylesheet' href='css/fullcalendar.css' />
<script src='js/jquery.min.js'></script>
<script src='js/moment.min.js'></script>
<script src='js/fullcalendar.js'></script>
<script type='text/javascript' src='js/gcal.js'></script>
<script src="js/calendar-events.js"></script>
<script type='text/javascript'>
$(document).ready(function() {
$('#calendar').fullCalendar({
googleCalendarApiKey: 'AIzaSyAl9hbpRJO_xVWj2RIZ1l0BwrvgwgMaWZg',
events: {
googleCalendarId: 'nr1e4148mosb7fpk8cf39dto1g#group.calendar.google.com'
}
});
});
</script>
Check and see if the Calendar API is listed as one of the 'Enabled APIs' in your project in the drop-down at the top of the APIs screen. If not - click the Calendar API and click Enable.
I know this issue is a bit stale, but it still took me forever to find a solution that worked. The api key and calendar id should be within eventSources. Also make sure that you have the latest version of fullcalendar (or atleast the latest gcal.js).
Below is the code the I found worked. I found the solution here.
eventSources: [
{ googleCalendarApiKey: 'your api key',
googleCalendarId: 'email#gmail.com',
className: 'fc-event-email'}]
Related
Anyone have any experience on doing a popup date picker
with multilingual support, based on the culture itself automatically?
I do try to do it but I am failed to do it. Anyone have any resources that can do it? I am mainly doing for two languages which is en-US and zh-TW. Thanks.
You are not adding the Jquery and CSS reference, that's why you are not able to see the Jquery Calendar.
Try the below code:-
Jquery and CSS reference
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
Also, you must call the selectori.e ID for it to work
$(function () {
$("#datepicker").datepicker();
});
See the Working Demo
I am practicing with Microsoft Dynamics CRM 2013 using REST 0Data endpoint with Web Resources.I have added an Iframe in case form and assigned a pagein the IFRAME URL and wrote the code snippet given on Microsoft Website
Now when I open a case from CRM Sales dashboard to check this IFRAME, it showing different errors in different browsers
in Chrome it display the text of the page but gives below error repeatedly
Sandbox access violation: Blocked a frame at
"https://diecho.crm5.dynamics.com" from accessing a frame at
"https://diecho.crm5.dynamics.com". The frame being accessed is
sandboxed and lacks the "allow-same-origin" flag.
in Firefox it display the text and when I open the Only Iframe code in different tab it gives below error in console
NetworkError: 404 Not Found -
https://diecho.crm5.dynamics.com//ClientGlobalContext.js.aspx"
Error: Context is not available. { throw new Error("Context is not available."); }
NetworkError: 404 Not Found -
https://s3-eu-west-1.amazonaws.com/987fsdr3e47f993ofskljd9/zone1-1003.js
in IE8 it gives below error:
This content cannot be displayed in a frame To help protect the
security of information you enter into this website, the publisher of
this content does not allow it to be displayed in a frame.
Please Help me
How to fix these errors?
What am I missing to enable on CRM or on Browser side to see the page in IFRAME?
In the Form Editor double click the iframe and make sure that the "Restrict cross-frame scripting, where supported." option is not checked.
Since you are accessing OData from HTML page, Xrm.Page.Context will throw you an error. In place of that you should use parent.Xrm.Page.Context.
Tested the same code as MSDN and it worked successfully.
<html><head>
<title>JQuery REST Data Operations</title>
<script src="../gap_jscript/jquery.min.js" type="text/javascript"></script>
<script src="../gap_jscript/SDK.JQuery.js" type="text/javascript"></script>
<script src="../gap_jscript/json2.js" type="text/javascript"></script>
<script src="../gap_jscript/TestODATAExample.js" type="text/javascript"></script>
<script src="../ClientGlobalContext.js.aspx" type="text/javascript"></script>
<meta charset="utf-8">
</head>
<body style="font-family: Segoe UI; background-color: white;">
<button title="Click this button to start the sample." id="start">Start</button>
<button title="Click this button to reset the sample." disabled="disabled" id="reset">Reset</button>
<ol id="output">
</ol>
</body>
</html>
I have asp.net usercontrol and I should implement simple client functionality - send two numbers to the server. I use devexpress, which allow me to send only one string on callback to server. So I don't want to invent a wheel and just use JSON.stringify method.
<script type="text/javascript" src="https://raw.github.com/douglascrockford/JSON-js/master/json2.js"></script>
<cc1:Button runat="server" ClientSideEvents-Click="
function(s,e)
{
cbpanelCtrl.PerformCallback(JSON.stringify({width: 800, height: 600}));
}"
Text="Reload"
AutoPostBack="false">
Everything works fine in firefox but error raised in IE: Microsoft JScript runtime error: 'JSON' is undefined
Why? How should I load script properly?
Check whether or not the JSON object is available in the current context in the problematic browser:
<script type="text/javascript" src="https://raw.github.com/douglascrockford/JSON-js/master/json2.js"></script>
<script type="text/javascript">
alert(typeof(JSON));
alert(typeof(JSON.stringify));
</script>
Turned out that I just use wrong library. I used old version which is not supported by IE. Everyting fine with recent version here http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js
This was working on Friday, and now isn't. I've got this at the beginning of a UserControl:
<link type="text/css" href="/App_Themes/css/ui-lightness/jquery-ui-1.8.11.custom.css" rel="stylesheet" />
<script src="/Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#MainContent_ucSearchControl_dpPickupStart").datepicker();
$("#MainContent_ucSearchControl_dpPickupEnd").datepicker();
});
</script>
And further down, this:
<td><asp:TextBox id="dpPickupStart" runat="server" style="width: 65px"/></td>
<td><asp:TextBox id="dpPickupEnd" runat="server" style="width: 65px"/></td>
Which results in (in the rendered page) input controls with:
name="ctl00$ctl00$MainContent$ucSearchControl$dpPickupStart" id="MainContent_ucSearchControl_dpPickupStart"
name="ctl00$ctl00$MainContent$ucSearchControl$dpPickupEnd" id="MainContent_ucSearchControl_dpPickupEnd"
And yet, every time the page loads, I get an Object Expected javascript error which points to the $(document).ready location.
What am I missing?
EDIT: Firebug is reporting that:
$ is not defined
[Break On This Error] $(document).ready(function () {
Being a user control you cannot guarantee that the relative path to your JS files will always be correct depending on the location of the parent page in the file system hierarchy.
Therefore change you JS script tags as follows to use the Control.ResolveUrl method which converts a URL into one that is usable on the requesting client.
<script src='<%=ResolveUrl("~/Scripts/jquery-1.5.1.min.js")%>' type="text/javascript"></script>
<script src='<%=ResolveUrl("~/Scripts/jquery-ui-1.8.11.custom.min.js")%>' type="text/javascript"></script>
Or reference from a CDN for added performace bonus of caching.
jQuery hosted on google
jQuery UI hosted on google
That error is caused due to Jquery not available. I think Swaff's solution should work(+1). Check if you have the Jquery-1.5.1.min.js file is available in Scripts folder of your solution. Or it could also be that your Scripts folder is renamed.
HTH.
Ok so I'm not very familiar with Jquery as to know the possible cause of this, but I've been assigned to find out why the datepicker doesn't work porperly on a client's computer (it prints out the date without slashes like this: 24112008
So when I test the webform, I see it doesnt even pop up in Firefox (the client's browser too) nor chrome, only in IE8.
In the scriptManager we have:
<script src="http://www.website.com/Script/jquery.min.js" type="text/javascript"></script>
<script src="http://www.website.com/Script/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://www.website.com/Script/jquery-ui-i18n.min.js" type="text/javascript"></script>
and in the webform:
$(function pageLoad(sender, args) {
// Datepicker
$.datepicker.setDefaults($.extend({ showMonthAfterYear: false }, $.datepicker.regional['']));
$(".dates").datepicker($.datepicker.regional['es']);
});
The textbox that uses it goes like this:
<asp:TextBox ID="txtFeNac" CssClass="dates" style="margin-left: 7px" runat="server" ></asp:TextBox>
I'm not familiar with regionalizing the datepicker but I'll try to help. What do you mean by "it prints out the date without slashes"? The datepicker only runs on the client, so the date format when the page loads is set in the code-behind file when the field is populated or through data binding.
jQuery is usually initialized in $(document).ready or pageLoad in ASP.NET (if there's an update panel present). I'm not sure what the effect of "$(function pageLoad(sender, args)" will be.
I would start by changing the client side code to the following then working in the 'es' regionalization once that works.
$(document).ready(function() {
$('.dates').datepicker({ showMonthAfterYear: false, onSelect: function() {} });
});
The onSelect: function() {} option works around a bug in IE or FF, I don't remember which.
I'm not sure if this relates to your problem or if it's just a piece of confusion on my part: should you have a element that adds the jquery.datepick.js file (or other file with the datepicker plugin) to your page?
I don't see it in your code samples. Is it packaged with jquery-ui in your case?