Ajax String Building - Which is better?

Which is better?

This:

<AjaxMethod()> _
Public Function GetString() as String
   return 
"The String"
End Function

<Script>
  
function getTheStringCallback(res) {
    document.write("
<table><tr><td>" + res.value + "</td></tr></table>");
    }
</Script>

Or This:

<AjaxMethod()> _
Public Function GetString() as String
    Return 
"

The String
"
End Function

<
SCRIPT>
  
function getTheStringCallback(res) {
    document.write(res.value);
      }
</SCRIPT>

When writing AJAX code, do you build the output JavaScript side, or Server Side?  I prefer Server Side.  (I'm more familiar with VB than JS).  Maybe I'm just lazy.

Print | posted on Friday, December 09, 2005 2:09 PM

Feedback

No comments posted yet.
Title  
Name
Email (never displayed)
Url
Comments   
Please add 8 and 6 and type the answer here: