Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!

Rob Crowther

author
Ranch Hand
+ Follow
since Nov 06, 2012
Rob likes ...
Android Fedora Firefox Browser
Cows and Likes
Cows
Total received
5
In last 30 days
0
Total given
0
Likes
Total received
48
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rob Crowther

If you want the value as a date, use valueAsDate. Be aware that this property will not be available if the browser does not support HTML5 date inputs, use a polyfill to get consistent behaviour.

J. Kevin Robbins wrote:But think about this for a minute; how are you going to validate that the input is a valid date? What if the user enters 13-42-2014? Or 10-FF-2014?

My advice; save yourself a lot of grief and use DatePicker.



If he's using a browser which supports HTML5 date inputs, he's already using a date picker.
Does your web page have an incorrect DOCTYPE declaration? Or are you viewing the page on an intranet server? In either case it's possible IE has decided to switch into compatibility view, effectively IE7, so none of the more modern features would be available.

Replace [FQDN] with whatever your fully qualified domain name is.

David Johnnsohnn wrote:I think we agree.



No, we don't. There is no implicit/explicit distinction.

David Johnnsohnn wrote:Citing just the directory name does give the impression of a hierarchical organization of the website



It doesn't need to be a directory name. There is no necessary link between the URI requested and the filesystem on the server. Try having a read of this Node.js routing tutorial.
They're not. The server receives a request, the server sends a response, there's no need for the filesystem to have anything to do with it.
That depends entirely on the configuration of the web server. There is no requirement that it should work that way.
Personally I prefer to capture the submit event for validation, because then it still gets called if the user submits with the keyboard (eg. by hitting Enter in a text input) as well as when they click the button.

David Johnnsohnn wrote:If this is a directory, and i click on it, the browser returns the contents of the directory.



No, it doesn't. It displays what the server returns for the requested URI. Where are you clicking on this directory? The primary purpose of the browser is not to talk to your filesystem, it is to talk to a web server.

David Johnnsohnn wrote:In other words, I cannot understand what file of html to have where and what to call it so that HTML is returned, not the contents of the directory.



Because you appear to be thinking about everything backwards. The server gets the request, the server decides the response to send. Files and what they're called are largely irrelevant to the whole process unless you happen to have configured a web server to echo the contents of the filesystem over HTTP. Or to put it another way: just because you have a file "fastcars.html" in a directory, it doesn't automatically follow that the server will send the file "fastcars.html" in response to a URI which contains that name.

I advise you to read up on HTTP, stop trying to think of a web browser as a file browser.

James Whitemore wrote:But I hardly find any information on how to work with existing server side components



I'm not sure why you'd need to? They're both client-side libraries? None of the code in either of the libraries is going to execute on the server.

James Whitemore wrote:Is this still in its alpha stages . Is this production ready yet ? I don't find too many examples/samples on it integrating with server side components.



The spec is new, the browser support info for both libraries is on the respective websites.
What do you mean by "chain object1 to object2"? Why do you think there is an object chain? It seems like you're still trying to do Java objects.

David Johnnsohnn wrote:I have seen anchor tags now that do not explicitly cite an HTML file. How does this work?



It works the same as any other link. The browser builds the URI, requests that URI, then the server returns the resource associated with that URI.

David Johnnsohnn wrote:Is "/fastcars" a directory?



It might be, from the browser's point of view it's not really important. The request will be made, the server will send a response, the browser will decide what to do with that response based on what the HTTP headers say it is.

David Johnnsohnn wrote: What does this anchor actually link to?



It links to the resource at that URI.
Is there a situation where the first and last values will not be the first and last ones output by your loop?
X-Tag and Polymer allow you to create components using the same syntax and approach as the W3C standard for creating web components.
MDV.mainNav is a function with six named arguments. By the look of it those are being sanity checked and given default values, though I think this is actually unnecessary, more on that later.

If you call a function without specifying all the arguments then the remaining arguments will have a type undefined, that's what all those if (typeof lines do. So if you call:

Then all of those arguments will have type undefined within the function. If, on the other hand, you call:

Then ulTagId, parentUrl, showSiblings and showChildren will all have a type (ie will not be of type undefined), but showFourthLevel and pageTitleTagId will still be of type undefined.

Depending on whether the argument parentUrl has been passed MDV.gNav.Generator.init function is called either with no arguments or being passed a single parameter. The parameter being passed in the latter case is an object (that's what the squiggly brackets are - an object is being created inline to pass to the function).

The second case is why I said earlier that giving the default values was unnecessary. The 'pass an object' in pattern is fairly common in JavaScript, the function has a set of defaults defined as an object then the argument is merged into that default. This approach has the advantage that you can add your parameters to the object in any order and, if you want to accept the default, you just don't add that property as opposed to calling a function with multiple arguments where it is awkward to pass the (say) only the first, third and fifth arguments. So, assuming the init function follows this patter, what I'd actually expect the mainNav function to look like is:

However, that is by the way, and you've not posted the definition for init so I can't be sure. As far as your problem is concerned I would guess that showSiblings is not working because that value is not getting passed into MDV.gNav.Generator.init as part of that single object parameter. Probably what you need is:

Bear Bibeault wrote:
You could look at the sources for the jQuery UI widgets to see how they were written, but I'm not a particularly big fan of their approach. YMMV.


For a more standards based approach you should take a look at the Web Compenents specifications and the X-Tag and Polymer libraries.