1

I've a problem with my SharePoint-Javascript.
In IE and FF it works propably fine, but in Chrome it won't work.
The script is called on a refresh of the main page and auto adds some users in a calendar.
Here's the code:

function _firstTime() {

    SelectRibbonTab('Ribbon.Calendar.Calendar', true);

    setTimeout('_doWireUp();', 2000);

}

function _doWireUp() {
    var weekElem = document.getElementById('Ribbon.Calendar.Calendar.Scope.WeekGroup-Large');
    if (weekElem) weekElem.onclick = function() {
        setTimeout('_setDefaultResources();', 1000);
        return false;
    };

    var dayElem = document.getElementById('Ribbon.Calendar.Calendar.Scope.DayGroup-Large');

    if (dayElem) dayElem.onclick = function() {
        setTimeout('_setDefaultResources();', 1000);
        return false;
    };

    _setDefaultResources();
}

function _setDefaultResources() {
    var ret = '---some voodoo with names and sth like that from fiddler ;-) ---';
    var sel = SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(1, 'WPQ3');
    sel.selectEntities(ret, true);
}

ExecuteOrDelayUntilScriptLoaded(_firstTime, "sp.ribbon.js"); 

At the Javaconsole in Chrome there's no error.
Thanks in advance.

  • if you look at chrome dev tools (F12) what errors do you have? – dbardakov May 28 '15 at 10:03
  • as i wrote in my question, I can't see any error – user42772 May 28 '15 at 11:01
  • did you able to step into __firstTime in debug mode? – dbardakov May 28 '15 at 11:06
  • This kind of errors could be caused by 1)not well formed block of code 2)different browser implementation of native js functions (like setTimeout ) – dbardakov May 28 '15 at 11:08
  • in ff and ie it works fine...so i think only option 2) is possible..? – user42772 May 28 '15 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.