Loving all your questions ralph
| SitePoint Sponsor |





Loving all your questions ralph


Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
Try your hand at the new JavaScript Challenge!
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.

I think this would make a more interesting version of the alerts question
a) 10, 10Code:"use strict"; x = 10; function hello() { var x = 5; alert(x); } hello(); alert(x);
b) 5, 5
c) 5, 10
d) syntax error because the code doesn't declare the global variable x before trying to use it.
or possibly this one.
Assume that the browser is Opera and that you check the checkbox in each alert before pressing the OK button.
a) 10, 10Code:"use strict"; var x = 10; function hello() { var x = 5; alert(x); } hello(); alert(x);
b) 5, 5
c) 5, 10
d) 5 and then nothing because JavaScript is disabled before returning from the first alert.
![]()
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">






If it only worked with :active then you'd only see the accordion opening while the user is holding down the button. :active states don't stay.Originally Posted by connor
Unless I'm missing something.
Felgall thanks for the correction of indexOf.

How well do you know your JavaScript from your jQuery?
Check out SitePoint's latest JavaScript challenge
My blog


I have pondered your questions deeply.
Originally Posted by And in response, thus spake the Oracle:
};-) http://www.xhtmlcoder.com/
Thinking Web: Voices of the Community
> March 2013 - SitePoint forums: Spot the Error 3: Calling all Sleuths! Winner Announced!... She knows how to spot simple <code> errors but do you?






Lawlz yeah you can have
<div id="♥"> if ya want nowadays.


Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
Try your hand at the new JavaScript Challenge!
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.


Actually Poes, I was thinking something more like: <p id="<!--<a><div>http://html5sucks.org/</div></a>-->"></p> for a valid HTML5 id attribute value.
};-) http://www.xhtmlcoder.com/
Thinking Web: Voices of the Community
> March 2013 - SitePoint forums: Spot the Error 3: Calling all Sleuths! Winner Announced!... She knows how to spot simple <code> errors but do you?

Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
Ah never mind...


Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
Try your hand at the new JavaScript Challenge!
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.

Another JavaScript question:
Consider the following code:
Code:function hello( str1, str2 ) { console.log( str1 + " " + str2 ); } hello.call(this, "hello", "world");
Why do we use call() to invoke this function?
a) This is how all functions are invoked.
b) To pass in the "this" parameter.
c) To pass in a scope variable (this) and 0 or more arguments
d) You can't invoke a function this way.
var details = {
. . web: "afterlight.com.au",
. . photos: "jvdl.id.au",
. . psa: "usethelatestversion.com"
}

Hi there @James08 ;
Here are some Rails questions to get things rolling.
The correct answer is always the first one.
Which architecture pattern does Rails implement?
Model-View-Controller
Model View Presenter
Operational Data Store
Event-driven architecture
Which component of Rails responds to external requests from the web server?
Controller
Model
Helper
Database
How would you declare a 1:n assosciation in Rails?
Using "has_many" and "belongs_to"
Using "has_one" and "has_n"
Using "has_many" and ":dependent"
Using "has_and_belongs_to_many"
What purpose does the asset pipeline serve?
To concatenate and minify JavaScript and CSS files
To cache and compress images
To speed up database queries
To reduce server latency
Which command should you run to make rails aware of a change in your database schema?
rake db:migrate
rake db:update
rake db:teardown
rake db:reload
What will the following output?
"Sitepoint Rocks!"Code:p "SITEPOINT ROCKS!".downcase.gsub(/\b\w/) { |match| match.upcase }
"sitepoint rocks!"
"SITEPOINT rocks!"
"SiTePoInT RoCkS!"
What will the following output?
<a href="/users/1">User Details</a>Code:@user = User.find(1) <%= link_to "User Details", user_path(@user) %>
<a href="/users?id=1">User Details</a>
<a href="http://www.yoursite.com/users/1">User Details</a>
Nothing, you cannot pass user_path an object
How would you generate the following:
file_field(:post, :attached, :accept => 'text/html')Code:<input accept="text/html" type="file" id="post_attached" name="post[attached]" />
file_field(:id => 'post', :name => 'attached', :accept => 'text/html')
input_field(:post, :attached, :accept => 'text/html')
input_field(:type=> 'file', :id => 'post', :name => 'attached', :accept => 'text/html')
Which ORM does Rails use to connect classes to relational database tables
Active Record
Active Mapper
Active Object
Active Data
What would the following output?
1.240,99Code:number_with_delimiter(1240.99, ".", ",")
1,240.99
1240,99
1240.99
How well do you know your JavaScript from your jQuery?
Check out SitePoint's latest JavaScript challenge
My blog
How many widget areas can you have on a WordPress powered blog?
1, 2, 5, As much as you want






zcorpan I figured he meant what Microsoft considered a comment.


Egad, you are right, I made a typo.Thanks for spotting it. Hope it hasn't made it into the system yet. Sorry @James08 ! Ammended question here: http://www.sitepoint.com/forums/show...=1#post5257191
Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
Try your hand at the new JavaScript Challenge!
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.
Also note that <!-- (and --> which also acts as a line comment if it appears at the start of a line) isn't yet specified in ECMAScript. It's specified here, though: http://javascript.spec.whatwg.org/#comment-syntax
Simon Pieters
Hey all, I am brand new to web design and these are questions I am either still fumbling with, or have very recently found the answer to.
Q) - what part of a completed site does HTML contribute to ?
Q) - what part of this page (some dynamic page) does JS control ?
Q) - Something related to -> When to use CSS and when to use JS if they can both produce the same results.






I think squigworm's questions are excellent in their own right, but I dunno how good they'd be in a quiz, since quizzes seem to do best with questions where the answer is obvious and look-up-able. Questions like when to use CSS vs JS for effects can have rules of thumb, but they're often best answered with explorations into reasons, effects on users and things like speed, CPU usage, etc.
Or, if the quiz will have essay-style questions, these would be good for those.
I agree with Stomme poes in terms of how I worded the examples, the actual questions would look more like: "what part of a website does HTML typically control? A) Stylizes the page B) Creates the skeleton structure C) Handles placement of the images (something to that effect) I know this sounds so very remedial to anyone who has been doing this for a while but it is what us beginners are trying to wrap our heads around.<- this is exactlyyyy the type of info I am looking for! A question could simply be "what will you need to consider when choosing between CSS and and JS? A) CPU usage B) I'd put something here but I only knew the first one cause you said itQuestions like when to use CSS vs JS for effects can have rules of thumb, but they're often best answered with explorations into reasons, effects on users and things like speed, CPU usage, etc.C) etc D) etc.
Bookmarks