Hey fernando,
I read that part as well, but I think those are more specific cases than the
one I'm dealing with. Take the following example (I defined the width of the
containing block for clarity):
div id=container
div id=test/div
/div
/*css*/
#container{
width: 400px;
border:
?
On 2011-05-16, at 8:59 AM, Joel Dart wrote:
Hey fernando,
I read that part as well, but I think those are more specific cases than the
one I'm dealing with. Take the following example (I defined the width of the
containing block for clarity):
div id=container
div id=test/div
/div
/*css
Hey Sheldon,
It does return 20px, also, I assumed it was a webkit issue since it failed on
Chrome, but Safari actually does produce the correct value. I've reported the
bug to Firefox, Chrome, and Opera.
--
To view archived discussions from the original JSMentors Mailman list:
According to the CSS 2.1 spec, a computed value of 'auto' for
'margin-left'http://www.w3.org/TR/CSS21/box.html#propdef-margin-left or
'margin-right'http://www.w3.org/TR/CSS21/box.html#propdef-margin-right
becomes a used value of '0':
Joel,
that wouldn't stop me from developing in Javascript ;-)
Haha, no way! I can always just switch to solely node ;-]
I understand this is not the right answer to your question, it wasn't easy
either
guessing why these differences still exists in 2011 browsers.
Yeah, offsetLeft works for
The problem is not with the rendering in those browsers. The problem is that
the return value of window.getComputedStyle(test,
null).getPropertyValue(margin-left) is 0px which is clearly not the used
value for margin-left.
Also, to be clear, I wasn't looking for a workaround for this issue
Yeah, the MVVM pattern definitely goes against traditional web SOC in favor of
a more pragmatic separation of business and interface logic, ie what JavaScript
runs my app vs what JavaScript runs my dom. This is especially useful when
generating multiple items from a template and having the
To get around it, I've added the following to run on every page of the site:
jQuery('a').click(function(){document.location.href=this.href});
I don't like this very much - it feels a little dangerous for reasons I can't
put my finger on.
The reason your gut is saying this is a dangerous is
Also be sure to read this thread from earlier where Christian Johansen weighs
in on this directly:
http://groups.google.com/group/jsmentors/browse_thread/thread/da28fe220dea609/fd44ec9cf4223e03?hl=enlnk=gstq=testing#fd44ec9cf4223e03
From: jsmentors@googlegroups.com
1. Body will bubble up through HTML to document. document doesn't have any
place to bubble.
2. You don't have to use the dom when doing jQuery custom events.
$(document).trigger works the same way as $(myNS).trigger where myNS is your
global namespaced object
This probably makes more sense
For me personally, I can't code without code folding. But that's nowadays part
of most text editors as well, one way or the other. Visual studio otoh has an
epic
fail in this regard.
If you have VS2010, you can actually get code folding as part of the JScript
Editor Extensions:
Since you mentioned it, Visual Studio 2010 will autocomplete cross files
provided you reference the file at the very top. You can drag and drop the
file from your solution, but you'll have to include /all/ your dependencies and
be the very first comments at the top of the file (before
I really didn't expect any output. It was doing fine until I used new. Without
new it returns a number object. But when I tried to use new and logged it on
the console, there I saw this output. Couldn't understand whether its a
number or its an object.
*Plug for JavaScript Patterns by Stoyan
Why? Well, simply because that's how the specification says it should be.
I'm taking a guess here, trying to justify this and would appreciate feedback
in my thinking. Since new has to set up the prototype chain, it would
necessarily have to return an object since primitives do not have
You also probably have a helper method in your base library, for example in
jQuery, jQuery.now() wraps (new Date()).getTime()
-Original Message-
From: jsmentors@googlegroups.com [mailto:jsment...@googlegroups.com] On Behalf
Of Ben Barber
Sent: Monday, December 20, 2010 12:23 PM
To:
Since you have returned a new object rather than using `this`, an instance of
your `Circle` won't respond to `instanceof Circle`.
Concerning instanceof on custom objects, what scenarios do you find it
necessary vs duck typing(http://en.wikipedia.org/wiki/Duck_typing)? I can see
the advantage
Concerning the 1 file vs many files, one common approach is to combine your
files on production but develop the files separately. You can use Squishit
(http://www.codethinked.com/post/2010/05/26/SquishIt-The-Friendly-ASPNET-JavaScript-and-CSS-Squisher.aspx)
for an asp.net site and it will even
17 matches
Mail list logo