Next: , Up: (dir)

Scripting Languages G22.3033-002 Summer 2008


Previous: Top, Up: Top

Scripting Languages G22.3033-002 Summer 2008 Example solutions for quiz3

Thursday 7/17/2008. 30 points.

http://www.cs.nyu.edu/courses/summer08/G22.3033-002/


Next: , Up: solutions-quiz3

Instructions for example solutions

These are example solutions. Please keep in mind that often, there is not just one correct solution to a question. If you come up with different answers, then it may be that both your answers and these answers here are correct. Of course, these answers here may also contain mistakes. If you spot a mistake, please let me know so I can correct it.


Previous: Instructions, Up: solutions-quiz3

Example solutions for Quiz 3


Next: , Up: Solutions-quiz3

solutions-quiz3-1 Closures

  1.           a=1, b=2
              a=3, b=2
         
  2. inner
  3. The call object for the call outer(2), with the binding b=2. Since the call object refers to the same global object both during and after the call, the binding for a changes from a=1 to a=3.


Next: , Previous: solutions-quiz3-1, Up: Solutions-quiz3

solutions-quiz3-2 AJAX

  1. Asynchronous Javascript And XML.
  2. The user does not have to wait while the script communicates with the server.


Previous: solutions-quiz3-2, Up: Solutions-quiz3

solutions-quiz3-3 Security

  1. User input that contains malicious SQL code, which gets used as part of a SQL query.
  2. The malicious SQL code could delete data from the database.
  3. By sanitizing all user data. Any user data that gets used as part of SQL must be cleaned of anything that looks like SQL.