Textarea.getAttribute CodeMirror nie jest błędem funkcji w aplikacji mvc3

Im using codemirror in my ASP.NET MVC 3 application, codemirrorwersja s jest aktualna (2.34)

mój TextArea wygląda tak:

@Html.TextAreaFieldFor(s => s.Data.CodeBehind, htmlAttributes: new Dictionary<string, object> { { "class", "textbox codeBehind nffp-code" } })

Używam codemirror w ten sposób:

var a = CodeMirror.fromTextArea($code, {
        lineNumbers: true,
        matchBrackets: true,
        mode: "text/x-csharp"
});

gdzie jest kod $

var $code = jQuery('.nffp-code', $root);

A po załadowaniu strony mam ten błąd:

TypeError: textarea.getAttribute nie jest funkcją codemirror.js Linia 2209 textarea.getAttribute ("autofocus")! = Null && hasFocus == document.body;

Użyłem tego podręcznika do używania codemirror:podręcznik

Nawet myślałemm a total noob in JS, I guess itciężko to zrobić źle, nadal tak.

Jakieś pomysły jak naprawić promblem?

questionAnswers(2)

yourAnswerToTheQuestion