2013-05-02 2 views
1

Следующий код дает DOJO Неопределенная ошибка, пока я запускаю его в Internet Explorer.DOJO Неопределенная ошибка

<script language="text/javascript" src="dojoroot/dojo/dojo.js" 
djConfig="parseOnLoad: true,isDebug:false" ></script> 

<script type="text/javascript"> 
    function readFile() { 
     dojo.xhrGet({ 

     url: "http://www.jnerlich.de/servlets/ReturnParameters", 
     handleAs: "text", 
     timeout: 5000, 
     load: function(response, ioArgs) { 
      dojo.byId("replace").innerHTML = response;    
         return response; 
     }, 
     error: function(response, ioArgs) { 
     console.error("HTTP status code: ", ioArgs.xhr.status); 
     dojo.byId("replace").innerHTML = 'Loading the ressource from the server did not work'; 
     return response; 
      }, 


     content: {name: "lars", url:"testing" } 
     }); 
     } 
    </script> 

Ошибка Я получаю в этой точке

dojo.byId("replace").innerHTML = 'Loading the ressource from the server did not work'; 

ответ

0

Какая версия IE?

This fiddle работает в IE9. Вы уверены, что элемент replace существует в вашем DOM?

function readFile() { 
    var content = { 
     name: "lars", 
     url: "testing" 
    }; 
    dojo.xhrPost({ 
     url: "/echo/html/", 
     handleAs: "text", 
     timeout: 5000, 
     load: function (response, ioArgs) { 
      console.log("load", arguments); 
      dojo.byId("replace").innerHTML = response; 
      return response; 
     }, 
     error: function (response, ioArgs) { 
      console.log("error", arguments); 
      console.error("HTTP status code: ", ioArgs.xhr.status); 
      dojo.byId("replace").innerHTML = 'Loading the ressource from the server did not work'; 
      return response; 
     }, 
     content: { 
      html: JSON.stringify(content) 
     } 
    }); 
} 

EDIT - Для IE может понадобиться для просмотра в full screen mode, как регулярная jsfiddle страница не будет правильно загружать в IE8.

Результаты:

enter image description here

+0

** IE ВАРИАНТ 8 ** – pratik

+0

Он также работает в IE8. –

+0

** Я не работает, но не работает в IE8 ** – pratik

Смежные вопросы