TypeError: this. $ E_0.getElementsByTagName is not a function

I am trying to create a modal dialog in sharepoint 2010, but I am getting this error:

TypeError: this.$E_0.getElementsByTagName is not a function

my code is:

var options = SP.UI.$create_DialogOptions();
options.html = '<div class="ExternalClass23FFBC76391C4EA5A86FC05D3D9A1904"><p>RedConnect is now available.​</p></div>';
options.width = 700;
options.height = 700;
SP.UI.ModalDialog.showModalDialog(options);

using firebug, I just tried using the url field instead of the html field and did not give any errors.

also related to this, which makes SP.UI. Is $ create_DialogOptions () really? what is the difference between using it and just using value values ​​for your parameters?

+5
source share
1 answer

options.html HTML DOM element required instead of regular HTML:

<script>

  function ShowDialog()
  {
    var htmlElement = document.createElement('p');

    var helloWorldNode = document.createTextNode('Hello world!');
    htmlElement.appendChild(helloWorldNode);

    var options = {
        html: htmlElement,
        autoSize:true,
        allowMaximize:true,
        title: 'Test dialog',
        showClose: true,
    };

    var dialog = SP.UI.ModalDialog.showModalDialog(options);
  }

</script>

<a href="javascript:ShowDialog()">Boo</a>

, html SharePoint DOM, .

, SP.UI. $create_DialogOptions() ? .

SP.UI.DialogOptions "class" SP.UI.Dialog.debug.js, , javascript.

SP.UI.DialogOptions = function() {}
SP.UI.$create_DialogOptions = function() {ULSTYE:;
    return new SP.UI.DialogOptions();
}

, . SO: Javascript?

+7

All Articles