Function ApplyFormatting(strInput)
strInput = Replace(strInput, Chr(13) , " ") 'vbCr
strInput = Replace(strInput, Chr(10) , " ") 'vbCrLf
'vbNewline vbLf vbTab \n
ApplyFormatting = strInput
End Function
There was also a need to remove the last comma (,) at the end of the ITEMS array. So I created a String, appended each item to that then at the end removed the last one.
You could connect to a Database and loop through a RecordSet.
Dim strItems
strItems = ""
If NOT rs.EOF Then rs.MoveFirst
While NOT rs.EOF
strItems = strItems & "{"
strItems = strItems & " ""id"" : " & ApplyFormatting(rs("BlogID")) & " "
strItems = strItems & ","
'Add any other items
strItems = strItems & "}"
strItems = strItems & ","
'POST End
'Repeat more Posts
rs.MoveNext
'Loop
Wend
' Remove the last ","
strItems = Left(strItems, len(strItems)-1)
Response.Write(strItems)
You also need to escape any slashes, so in URLS a / needs to be \/ so it renders correctly.