Friday, December 16, 2011

Tuesday, November 15, 2011

Relative Module Identifiers (dojo, AMD)

Relative Module Identifiers:

A) Don’t use Relative Module Paths in require([]), only work in define([])
B) Don't use Relative Module Paths with global require use Context Sensitive _require

sample file:
path: dojo-boilerplate/js/myPackage/myModule/test3.js
no .js added at the end
// !!! bad
// /dojo-boilerplate/mySubmodule9/b 404 (Not Found)
// /myModule8/a 404 (Not Found)

 // dojo-boilerplate/js/myPackage/myModule/mySubmodule3.js
 //  !!! bad !!! dojo-boilerplate/mySubmodule4 
 // dojo-boilerplate/js/myPackage/myModule/mySubmodule6.js
 // dojo-boilerplate/js/myPackage/myModule/mySubmodule5.js
 // dojo-boilerplate/js/myPackage/myModule7.js  

Tuesday, November 1, 2011
Broken link to logo.png and header.pmg
Not working in MSIE 8
Crashing on GA code ? (Line: 35 Error: Object doesn't support this property or method)
Crashing on GA code ? this.set is not a function Line 35
broken link to:

Eclipse, WTP JavaScript Validator useless

WTP comes with JS Validator which is by default configured to
"Enable JavaScript semantic validation".

Defaults are set somehow but soon
you will have to turn OFF "the whole thing" because:

Optional Semicolon: Ignore
because of Dojo and other framework authors do not care

Local Variable is never read: Ignore
because it does not work, local.member is not considered reading local by WTP

Uninitialized local variables: Ignore
This is just JS style of me and many others

And after turning this all OFF, you will end up with
Type mismatch: cannot convert from any[] to any ItemFileWriteStore.js /dojo/data JavaScript Problem line 581
on simple lines like: var serializableArray = [];

Since this warning cannot be turned off (no UI item for this),
you must modify the plugin

Another piece of code that is useless, thanx for wasting my time again.

see also:

Eclipse IDE for JavaScript Web Developers
contains quite old version of the plugin:
plugin version org.eclipse.wst.jsdt.core_1.1.101.v201108151912.jar

Thursday, October 27, 2011

I just had a quick view to this, once popular web site.
I have found that this is deserted place full of outdated,
and almost harmful information...

so AJAX beginners (if there are any, anymore) BEWARE.

Just a few broken links....and dead topics....


HISTORY: last update: november 2009 

HISTORY: May 2011

I have tried to fix some articles but usually you end up with... 504 Gateway Time-out

Thursday, July 7, 2011

Hello DOJO !

Browsing this web site today, I have run into deep disapointment:

Error: Could not load 'dijit.form.Select'; last tried '../dijit/form/Select.js'
Source File:
Line: 14

Error: _onloadHook is not defined
Source File:
Line: 4

Error: missing ; before statement
Source File:
Line: 50, Column: 38
Source Code:
-b;if(c<0){f=Dialogif('cancel'){this.cancel();}else if(Dialog.call_or_eval(this,this._handler,{button:a})!==false)this.hide();},_submitForm:function(d,e,b){var c=this.getFormData();if(b)c[]=b.label;if(this._extra_data)copy_properties(c,this.

Error: _onloadHook is not defined
Source File:
Line: 4

shame on you, leading framework developers !

Thursday, June 16, 2011


Browse the link and logon, if you have account with them.
So they have "fixed" client side problem

and kept more serious
CWE-601: URL Redirection to Untrusted Site ('Open Redirect') still open ?

nice ....

Tuesday, June 14, 2011 and comments

Can we (miss) USE this somehow ?
Generated from data/head-home.php, ../../smarty/{head.tpl} 
 Generated from data/mast-home.php, ../../smarty/{mast.tpl} 
 #w3c_mast / Page top header 
 w3c_sec_nav is populated through js 
 Main navigation menu 
 /end #w3c_mast 
 end events talks 
 end main content 

    <div id="w3c_home_video">
      <h2 class="category">
        <a href="/participate/podcastsvideo">Featured Video
            <img src="/2008/site/images/header-link.gif" alt="Header link" width
="13" height="13" class="header-link"/>
 end main col 
 Generated from data/footer.php, ../../smarty/{footer-block.tpl} 
 #footer address / page signature 
 /end #footer 
 Generated from data/scripts.php, ../../smarty/{scripts.tpl} 

Monday, June 13, 2011


great library but:

//Can you simplify this ?
if (obj === null || other === null) {
      return (obj === null) && (other === null);

//.. do I need braces ? Throwing Strings ? Not good for onerror handlers... 
throw ("XMLHttpRequest failed, status code " + xhr.status);

// try to count number of "this." in minimized version ;-(
// how many times will you call the same functionn in one line....
a.charAt(0) === "(" || a.charAt(0) === "[") return a.charAt(0)

//loops; could be even shorter right ? (++ vs. --)
a = 0;
for (c = h.length; a < c; ++a) h[a].owner = this;

//could you be more verbose ?
//hardly !
DrawingShared.prototype.vertex = function() {
      var vert = [];

      if (firstVert) { firstVert = false; }

      if (arguments.length === 4) { //x, y, u, v
        vert[0] = arguments[0];
        vert[1] = arguments[1];
        vert[2] = 0;
        vert[3] = arguments[2];
        vert[4] = arguments[3];
      } else { // x, y, z, u, v
        vert[0] = arguments[0];
        vert[1] = arguments[1];
        vert[2] = arguments[2] || 0;
        vert[3] = arguments[3] || 0;
        vert[4] = arguments[4] || 0;

      vert["isVert"] = true;

      return vert;


TODO: will be continued

Saturday, June 11, 2011

Aptana - Editor Feature Matrix

What to expect and not expect from Aptana Studio 3.X Editors.

Thanx to aptana team for link.

Friday, June 10, 2011, CWE-209 (Error Message Information Leak)

Try this:

It will print nice detailed error message,
design or badly configured server ?

Aptana Studio 3.3 and html5boilerplate support

Aptana comes with nice feature and includes html5boilerplate
as wizard.
Excited I decided to give it a try.....

This wizard let's you open online (git) verzion or Cached version.
(nice !)

however both versions cause problems:
cached version is pretty old (referencing 1.4 jQuery) and fails with errors,

ENTRY com.aptana.projects 4 0 2011-06-10 00:45:42.917
!MESSAGE Unable to overwrite file during .zip extraction
org.eclipse.core.runtime.CoreException: Failed applying file-template variables

Git based version of the wizard is fine and gets created
however HTML editor reports errors:

Unexpected end of file index.html /test line 54 JS Problem

Horror folks !

UPDATE: filled bug report

and also

Thursday, June 9, 2011

Roo, Maven, STS and paranoid Corporate Proxies (fixed with Fiddler)

If you are using Roo, it uses
to verify signatures of downloaded Roo Add-on.

If your proxy blocks 11371 and
your proxy admin. is paranoid
(or just lazy)
you will hardly get adon installed.

Since I don't know how to change this uri (can I ?)
I open fiddler
and type in the Quick Exec box:

This now uses ubuntu keyserver and "standard" port 80.

Thanx for Fiddler once again.
TODO: Mac solution

Waiting response from Roo team.....

Monday, June 6, 2011

Aptana Studio 3 and HTML5 Support ?

One of the benefits in HTML5 is simplifications:

However Apatana (claiming HTML5 support)
made me disapointed
on my first trial:

<link rel="stylesheet" href="/boilerplate/styles/sample.css" />
This valid HTML5 construction results in warning:

link lacks "type" attribute 
Since I hate warnings and
I hate writing any extra code
I supressed the warning in
thax for that option at least.

Or am I doing something wrong ?

Nothing wrong, after private discussion with aptana team they resond with:

however I have no account to see the ticket ;-)

Tuesday, May 31, 2011

skipnav sass mixin

This is rewrite of excelent idea from as Sass mixin.

<nav class="my-skipnav">
 <a href="#maincontent">Skip to main content</a>
 <a href="#sitemap">Skip to footer site map</a>

// using traditional class
.my-skipnav {
 @include  a11y-skipnav;
// or using structure selector
body>nav:first-child {
 @include  a11y-skipnav;
@mixin a11y-skipnav {
 text-align: left;
 a {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;  
 a:focus, a:active {
  position: static;
  left: 0;
  width: auto;
  height: auto;
  overflow: visible;

Saturday, May 28, 2011

IBM home page improved

IBM has made several impovements in their homepage markup: so I want to give them credit after all blames I have made before....

I like usage of network path references,
even if it is not consistent across whole page.

Also usage of iepngfix, DD_belatedPNG.fix('#ibm-geo, #q, #ibm-search, .ibm-no-mobile');
is fancy, but, why they don't credit the original author ?

What I still hate is overuse of IDs, presentational classes and endless DIV nestings

<div class="ibm-container" id="ibm-leadspace-head">
<div class="ibm-container-body" id="ibm-leadspace-body">
<div class="ibm-columns" id="ibm-lead-1">
<div class="ibm-col-1-1">

<div id="ibm-pcon">
<div id="ibm-content">
<div id="ibm-content-body">
<div id="ibm-content-main">
<div id="ibm-news-feed">
<div id="ibm-news-feed-inner">

<div class="ibm-container" id="ibm-promotion-module">
<div class="ibm-container-body">
<div class="ibm-columns">
<!-- ibm-col-6-2 ibm-expand-section: Z725354V02338R50 -->
<div class="ibm-col-6-2 ibm-expand-section">
<!-- B302493F36942F04 -->

I believe IBM has finally started to watch Web trends and tries to apply them to their
web design (at least to home page).

It is still very basic improvements,
but I wish them good luck!

Thanx for making my day nicer (even if you have changed this a couple of weeks ago, I have found time only today).

For dark ages see ora or ms homepage markup.
Watch and learn !

Client side XSS: document.write(location.href)

Is this safe ?

if (USER.guid) {
    document.write('Welcome ' + USER.firstname + ' ( <a class=profile href=' + location.href + '\>' + 'Account' + '<\/a> | <a class=profile href=/us/corporate/contact/about-your-account-070507.html>' + 'Help' + '<\/a> | <a class=profile href=javascript:sso_sign_out();>' + 'Sign Out' + '<\/a> )');
else {
    document.write('<span class=profile>( ' + ' <a href=' + location.href + '>Sign In/Register for Account</a> ' + ' <span style=color: rgb(0, 0, 0)>|</span> ' + '<a href=/us/corporate/contact/about-your-account-070507.html>Help</a>' + ' )</span>');

UPDATE: 16.6.2011
Somehow they decided to fix it ? based on this article ? I dont believe so, if yes please next time give some credits by comment ;-)

if (USER.guid) {
    document.write('Welcome ' + USER.firstname + ' ( <a class=profile href=' + encodeURI(location.href) + '\>' + 'Account' + '<\/a> | <a class=profile href=/us/corporate/contact/about-your-account-070507.html>' + 'Help' + '<\/a> | <a class=profile href=javascript:sso_sign_out();>' + 'Sign Out' + '<\/a> )');
else {
    document.write('<span class=profile>( ' + ' <a href=' + encodeURI(location.href) + '>Sign In/Register for Account</a> ' + ' <span style=color: rgb(0, 0, 0)>|</span> ' + '<a href=/us/corporate/contact/about-your-account-070507.html>Help</a>' + ' )</span>');

Any ideas now ?

Friday, May 27, 2011

Sass Mixin For HTML5 classes and their obsolete HTML4 equivalents


@mixin back-compat($prefix) {
 @each $h5tag in 
   .#{$prefix}#{$h5tag} {
  @extend #{$h5tag}; 
sample usage

@include back-compat("html5-");
article, section, ruby

article, .html5-article, section, .html5-section, ruby, .html5-ruby {
  COLOR: red;
Nice nice....

Thursday, February 24, 2011

Link of the day !

thank you,thank you,thank you

Tuesday, January 25, 2011

Customize your Modernizr download (errors on page)

I have tried this web site today and have run ito "lame code" controlling the
checkboxes to customize download:

 $("a.toggle-group").live('click', function() {
    var group = $(this).closest(".features");
    var checkbox = $(group).find(':checkbox');
      $(this).attr('checked', !$(this).is(':checked'));

Please fix otherwise we will end with errors like:
Error: event is not defined

Source File:
Line: 173

Thursday, January 20, 2011

MSIE and incorrect .src and .href (final solution ?)

Could this be a final solution for uri resolving in .src and .href for MSIE ? (blogged before, search..)

function getUriRef(element, attrName) {
    //MSIE sometimes returns unnormalized .src or .href property 
    //for LINK and SCRIPT tags, it has not been observed on a.href
    // example: s.src returns "sss" instead of ptoto://auth/sss
    // this is observable always on "some" pages and "some" elements
    // in case .src does not work -> getAttribute('src',4) works
    // when .src works (returns abs. uri), getAttribute('src',4) does not work and returns (raw)
    // TODO: detect, dont do always, study reason why this happens
    var uri = element[attrName];
    if (uri != null) {
        if (!(/^[A-Z][0-9A-Z+\-\.]*:/i).test(uri)) {
            //TODO: TEST XB for additional param, but i dont expect any normal browser to fail here
            uri = element.getAttribute(attrName, 4);
    return uri;

Deadly jQuery Selectors (my naive jQuery programming)

Deadly jQuery Selectors (my naive jQuery programming)

// give me all tags with href or src attribute

//MSIE 8: 20000 ms ;-(
//FF 3.6: 1 ms :-)

// simple fix for this is to use plain old dom:

var uri, uris=[], i, e;
for (es = d().getElementsByTagName("*"), i = es.length; i; ) {
e = es[--i];
uri = e.href || e.src;
if (uri) uris.push(uri);
// MSIE 8: 323 ms ;-| not so bad

Tuesday, January 18, 2011

waitFor function

Blind code (not tested)
any comments welcomed

function waitFor(condition, onSuccess, onTimeout, timeout, pollInterval) {
    // TODO: document + testcase
    pollInterval || (pollInterval = 100);
    var endTime = new Date().valueOf() + (timeout || 10000),
  errs, //condition eval errors
        c,    // condition eval result (can be object)  
        check = function () {
            try { c = condition(); }
            catch (ex) { (errs = (errs || [])).push(ex); }
            if (c)
                onSuccess(c);   //receives condition result (ca be {})
            else if (new Date().valueOf() < endTime)
                setTimeout(check, pollInterval);
            else if (onTimeout)
                onTimeout(errs); //receives err result (null or non empty [] of Error)

Wednesday, January 12, 2011

Mobile Perf bookmarklet by @souders (Link of the day)

I have been very pleased by todays tweets
specially @souders compilation of other bookmarklets:

Mobile Perf bookmarklet

I have looked a bit closer to some of them:
DOM Monster
and I have posted two comments to GitHub:

Happy to receive reply:

From: madrobby

You're welcome to submit pull requests/patches. However, I think DOM Monster will grow and change quite a bit so premature micro-optimizations might be a 

might early...

View Issue:

I consider both issues as basic coding practice, not optimization ! (rename to JS Monster ?)
I'm not "skilled" with github (yet) sorry.

I'm willing to contribute, but cannot be forced into how and when.

Some ideas and wishes
from my own unfinished code performing "page analysis".
My code is not only performance based so some may not aplly to DOM Monster.
  • Inline Scripts Detection
  • Standard vs. Quircks mode
  • Empty ULs and others that cannot be empty (semantics)
  • Meta tag "best pracices"
  • Anti-SEO hunter (bad, old SEO practices detection)
  • jSession string and other identifiers in URLs
  • Accessibility checks
  • DHTML event registration
  • Ajax style links (# fragment links)
  • .... more and more

So my bookmarklet is/was mix and
I'm thinking (thanx to @souders)
about splitting it into more categories now
and maybe "reuse" existing code or whole bookmarklet,
once they will comply with minimal "js qualities" ;-)