Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Empty "for" loop in Facebook ajax

While surfing facebook and using the Firebug network debugger I noticed that facebook's AJAX responses all start with an empty for loop.

Example:

for(;;);{...}

Does anyone know why this is done? I assume it's to prevent some sort of XSS attack but I don't totally understand. Thanks!

like image 324
celticpride Avatar asked Sep 10 '25 22:09

celticpride


1 Answers

Like google's

while(1);

it done for preventing of including this in <script> with further using the data

like image 70
zerkms Avatar answered Sep 12 '25 13:09

zerkms