Loading

JSON looped data - FAILS

  1. <%@ LANGUAGE=VBScript %>
  2. <!--#INCLUDE FILE="aspJSON1.16.asp"-->
  3. <%
  4.  
  5. ' Set the page content headers
  6. Response.ContentType = "application/json"
  7. Response.Charset = "UTF-8"
  8.  
  9. ' Set the default response
  10. Set oJSONResponse = New aspJSON
  11. oJSONResponse.data("result") = "OK"
  12. oJSONResponse.data("details") = "JSON data parsed successfully"
  13. oJSONResponse.data("action") = "wtf"
  14.  
  15. ' Create the fieldPoints collection
  16. Set oJSONResponse.data("fieldPoints") = oJSONResponse.Collection()
  17.  
  18. ' Start the loop
  19. x = 1
  20. Do Until x = 5000
  21.  
  22.     Response.Write """fieldName"", ""field name here (x="&x&")""" & VbCrLf
  23.     Response.Write """fieldID"", ""field id here (x="&x&")""" & VbCrLf
  24.     Response.Write """fieldArea"", ""field area here (x="&x&")""" & VbCrLf
  25.     Response.Write """lat"", ""lat here (x="&x&")""" & VbCrLf
  26.     Response.Write """long"", ""long here (x="&x&")""" & VbCrLf
  27.     Response.Write VbCrLf
  28.  
  29. '    Set newitem = oJSONResponse.AddToCollection(oJSONResponse.data("fieldPoints"))
  30. '    newitem.add "fieldName", "field name here (x="&x&")"
  31. '    newitem.add "fieldID", "field id here (x="&x&")"
  32. '    newitem.add "fieldArea", "field area here (x="&x&")"
  33. '    newitem.add "lat", "lat here (x="&x&")"
  34. '    newitem.add "long", "long here (x="&x&")"
  35.  
  36.     x = x + 1
  37.     Response.Flush
  38. Loop
  39.  
  40. ' Write the response
  41. Response.Write oJSONResponse.JSONoutput()
  42.  
  43. ' Clean up
  44. Set oJSONResponse = nothing
  45.  
  46. %>

Version history

Revision # Author Created at
puncszuys Rich 27 Feb 2014, 15:45:50 UTC Diff
pcjd5pmzg Rich 27 Feb 2014, 15:44:45 UTC Diff
pjkazukuf Rich 27 Feb 2014, 15:44:03 UTC Diff

Comments

I came to your The DG2 Paste Bin page and noticed you could have a lot more traffic. I have found that the key to running a website is making sure the visitors you are getting are interested in your subject matter. We can send you targeted traffic and we let you try it for free. Get over 1,000 targeted visitors per day to your website. Check it out here: http://mylinks.top/h Unsubscribe here: http://pcgroup.com.uy/2a

Anonymous • 01 Sep 2017, 08:01:18 UTC