How to set InnerHTML with Ajax responseText

Dear All,I`ve found the solution for more than one week…God.

I`m developing the web Application in Domino R655.

I tried to use Ajax prototype.js framework to create a document .

when I got the responseText from Ajax function(can be displayed by alert function) and want to replace the innerHTML of DIV, it failed and nothing to display in IE 6…

But it worked fine in FireFox…

I looked for the solution for a long time…but still can`t find…

Is there any one successful to use Ajax for creating a document by calling OpenForm URL command ?

the code is listed below :

--------Start-----------

…

//I got the response object called Gajax

and then:

Element.update(“DIV_ID”,Gajax.transport.ResponseText);

--------End-----------

I can get the response value if I use :

alert(Gajax.transport.ResponseText);

of course ,the response also included JavaScript …

Please try to help me ~~~God

Subject: How to set InnerHTML with Ajax responseText

Not shure how you set up your Ajax call, but you need to handle the responseText as a callback object.

Using prototype, you would need to do something like this:

new Ajax.Request( url, { method: ‘get’, parameters: pars,

						onComplete: function(obj){$('DIV_ID').innerHTML = obj.responseText;},

						onFailure: function(){alert('An error has occured when saving the data!')}});

If you want, you can call another function, instead of setting the innerHTML directly.

Subject: Does the response include a form-tag?

I have noticed that IE does choke on a form-tag every now and then, while Firefox just accepts it. Please paste your response-text here?

Subject: How to set InnerHTML with Ajax responseText

You can even try -

Element.update($(id),request.responseText)

(id - is the DOM element id where u want to write the code)

(request - is the request from Ajax call)

HTH

–Phani

Subject: How to set InnerHTML with Ajax responseText

Try using this:

document.getElementById(‘DIV_ID’).innerHTML=Gajax.transport.ResponseText;

Remember to place the div element on the form and give the id DIV_ID.

Hope it will help