题目内容

If this form is loaded in a non-JS-aware browser:- 未答复

A. Browser will complain about malformed HTML when page is loaded (server should respect browser version and not send JavaScript)
Browser will complain, but only when form's Submit button clicked
C. The form will be submitted, but without inputs being checked
D. Nothing will happen when submit button is clicked (form won't be submitted)

查看答案
更多问题

When using JavaScript for client-side form validation, which is NOT true?

A. JavaScript code can inspect DOM element attributes to see what the user typed
B. JavaScript code can prevent the "Submit" button from submitting the form
C. Some validations may be impractical to perform on client so must be done on server
D. The server doesn't have to repeat validations already performed by JavaScript

Suppose we want to add a Theater model to Rotten Potatoes, with the assumption that a Theater is associated with one Movie, but a given Movie could be showing at many Theaters. In our Rails app we would like to be able to write movie.theaters to obtain a list of all the theaters at which a movie is showing. Which statement is correct?- 未答复

A. The movies table will need a foreign key theater_id. We must add has_many :theaters to the Movie model. We must add has_many :movies to the Theater model. We must add belongs_to :theater to the Movie model.
B. We must add has_many :theaters to the Movie model.
C. We must add has_many :movies to the Theater model.
D. We must add belongs_to :theater to the Movie model.

Which of the following ActiveRecord lifecycle callbacks ("hooks") could get called when an ActiveRecord operation calls "create" (i.e. movie.create)? Select all that apply.

A. before_validation
B. after_validation
C. before_save
D. after_save

Given the following code:var Square = function(side) {this.side = side;this.area = function() {return this.side*this.side;} };Which call will evaluate to 9?

A. Square(3).area
B. Square(3).area()
C. (new Square(3)).area
D. var p=Square; (new p(3)).area()

答案查题题库