Why while(1); , for(;;); as the prefix of a REST Webservices response?
Posted: Wednesday, January 12, 2011 by Unknown in Labels: Coding practises/ProgrammingMost of the REST web services JSON response will be like
while(1);{"feedItem": "sdf","status": "sdfsdf","updateTime": "sdfsdf"}
for(;;);{"t":"continue"}
for(;;);["a","b","c"]
Just go through the HTTP calls made inside in Facebook, Google calender, Chatter ..etc then you can find such responses.
while(1); , for(;;); all these are infinite loops, this is ensure that some other websites cant hack other sites data. By using this we can prevent Cross domain AJAX requests made using script tags.
Nice information Venki.