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.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
Print | posted on Friday, December 09, 2005 2:09 PM

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: