开发者

Javascript function not found

I am having a problem with the jCal plugin. I have no javascript errors when the page is loaded locally however when the page is loaded online the jCal function can not be found. I think the jCal function is called before jCal/jCal.js file is executed. http://aidnetgc.com/test/volunteer.开发者_开发技巧html


GET http://aidnetgc.com/test/jCal/jCal.js 403 (Forbidden)

chmod jCal folder to 755


"jCal.js Failed to load resource: the server responded with a status of 403 (Forbidden)" looks like a permissions issue.


If you look at the Net tab in Firebug when viewing your site, you'll see that the jCal.js file is not being loaded.

It is giving a 403 Forbidden error.


If you tried to access the file using the url http://aidnetgc.com/test/jCal/jCal.css you will get a permission issue, so you have to give the right permission so that the jacl file get's loaded


Try changing your javascript to look like this:

<script language="JavaScript" type="text/javascript">

        $(document).ready(function () {
                $('#calTwo').jCal({
                    day:            new Date( (new Date()).setMonth( (new Date()).getMonth() ) ),
                    days:           1,
                    showMonths:     1,
                    dayOffset:      1,      // start week on Monday
                    dow:            ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
                    sDate:          new Date(),
                    dCheck:         function (day) {
                            return 'day';
                        },
                    callback:       function (day, days) {

                        var da = (day.getMonth() + 1 ) + '/' + day.getDate() + '/' + day.getFullYear();

                          if (jQuery.inArray(da, dates) == -1)
                          {
                            dates.push(da);
                          }
                            popDropdown();
                            return true;
                        }

                    });


            var dates = new Array();    


            $("#remove").click(function () { 

                var indexA = jQuery.inArray($("#datesPicks :selected").text(), dates)

                dates.splice(indexA,1);

                popDropdown();

                return false;

            });


             function popDropdown()
              {
                    //Clear the HTML Select DropdownList
                    $("#datesPicks option").remove();

                    //Add Default Option
                    //$("#datesPicks").append(GetOption("Please select a date", "0"));

                    //Loop through array and add options
                    $.each(dates, function (index) {
                        $("#datesPicks").append(GetOption(dates[index]));
                    });
              }

             function GetOption(text) 
             {
                    return "<option value = '" + text + "'>" + text + "</option>"
             }
</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜