# “a is null” error in vanilla SP2010 install

I'm setting up an SP2010 VM for dev testing purposes. Our vanilla install has no other components present and is throwing JS errors in Chrome and Firefox. In Firefox (v13):

a is null
http://hovmdvmrg06/_layouts/sp.ui.rte.js?rev=aTi1rujCmyK4y06NVUncdQ%3D%3D
Line 2


In Chrome (current):

Uncaught TypeError: Cannot call method 'parentElement' of null /_layouts/sp.ui.rte.js?rev=aTi1rujCmyK4y06NVUncdQ%3D%3D:2


This is a major blocker for me to test some JS I'm working on and my searches for the error isn't turning anything up. I don't know if it's related, but IE has an HTML warning:

HTML1114: Codepage unicode from (UNICODE byte order mark) overrides conflicting codepage windows-1252 from (11)


Opera 11 doesn't seem to throw the error either.

-
What is the patch level of the 2010 vanilla farm? –  PirateEric Jun 12 '12 at 14:56
I just checked this. It's at 14.0.6114.5001 –  patrickgamer Jun 12 '12 at 16:05
Welcome to Microsoft Sharepoint quality coding... –  George Katsanos Feb 20 '13 at 15:55

Only after SharePoint SP1 with Cumulative Update from April 2012 is Chrome almost "fully" supported as it has been announced in May 2012 on the Support site http://technet.microsoft.com/library/cc263526#supportmatrix

I would go for installing at least Service Pack 1, June Update and Refresh, and try again!

-
and this would be related to Firefox as well? Just checked, and we're already at 14.0.6114.5001 - latest version afaik –  patrickgamer Jun 12 '12 at 16:00
Are you using any DOCTYPE on your page? Did you closed all <script> tags with <script></script> when referring external scripts and not simple <script /> –  C. Marius - MVP Jun 12 '12 at 16:13
Nope. this is a strictly vanilla install - we literally installed it, took a snapshot, and started browsing the default pages (et. all) to check this thing out. Note that we originally thought we goofed on the install, so we created a fresh VM - same result. –  patrickgamer Jun 12 '12 at 17:35
As C. Marius mentioned, it is almost supported, even to this day, SP2010 is not fully supported (still has scrolling issues). –  Russell Jan 9 at 6:53
However SP2013 works as well in Chrome/firefox/safari (FWIHT) as IE. –  Russell Jan 9 at 6:54

You can actually load debug versions for js files and see exactly where it crashes. To do this, got to app pool web config, typically to C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config and set

compilation : debug=true

<compilation batch="false" debug="true">


I had a similar issue and it was fixed after a windows update.

-

Adding this to my master page fixed just about all of my Chrome issues

$(function(){$.browser.chrome = (typeof window.chrome === "object");

if($.browser.chrome) Reinit(); }); function Reinit() { if(typeof(_spBodyOnLoadWrapper) != "undefined") { if(_spBodyOnLoadCalled == false) _spBodyOnLoadWrapper(); } else setTimeout(Reinit, 10); }  - add comment I have seen a bug in the SP.UI.RTE.js file that Microsoft has still not resolved. To fix it on environment where I have seen behavior like this, I add the following JavaScript to the master page:  function fixRTEBug() { if (typeof RTE.Canvas.checkCurrentFocus !== 'undefined') { RTE.Canvas.checkCurrentFocus = function() {ULSkay:; var$v_0 = RTE.Selection.getSelectionRange();
if ($v_0) { //this is different from SP to avoid error in console var$v_1 = $v_0.parentElement(); if (RTE.Canvas.isInEditable($v_1) && !RTE.Cursor.get_range().isValid()) {
RTE.Cursor.updateRangeToCurrentSelection();
RTE.Cursor.update();
}
}
}
}

// This Fix for parentElement bug in RTE should survive Service Packs and CU's
function SubstituteRTERangeParentElement() {
var originalRTERangeParentElement = RTE.Range.prototype.parentElement;
RTE.Range.prototype.parentElement = function () {
try {
originalRTERangeParentElement();
} catch (e) { }
}
}
SubstituteRTERangeParentElement();
}