Donate Share

Java Web Parts

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Setting multiple innerHtml with response

You are viewing a single message from this topic. View all messages.

  1. 2009-03-16 02:56:52 UTC
    I'd suggest using the CodeExecuter response handler... your response would be something like:

    var content = [ "actual content1 with tags", "actual content2 with tags", "actual content3 with tags" ];
    document.getElementById("pagediva").innerHtml = content[0];
    document.getElementById("pagedivb").innerHtml = content[1];
    document.getElementById("pagedivc").innerHtml = content[2];

    That would probably be the most straightforward way to achieve this. I think the only "gotcha" is that on the server you'll need to ensure that the content values are escaped properly for insertion as Javascript strings... i.e., escape quotes and whatnot.

    For your second question, the answer is you would have to do it yourself. You'll get the response as a string as an argument to the custom handler only, what you do with it is entirely up to you, including conversion to XML. That being said, I could certainly see where the ability to receive a proper XML document would be nice... I could also see where being passed an actual object in the case of a JSON response would also be nice. I think these would be very good enhancement ideas.
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.