|
|
 |
 |
 |
 |
Javascript / Client Side Development
|
 |
 |
 |
 |
 |
 |
 |
 |
The fuel sintaxes of javey roadsters... here comes the long awaited AJAX ease facilitator... SGEMILSON
Oh!, oh!, oh!... erased (deleted)... the weird...ness of the fuel sintaxes, fuel sintaxes, ahum! of javey roadsters... here co... mes the lon... g awaited ea... se facilitator... S....G...E...M..I..L..S.O.N Longly and lenghtly SGEMILSON comes from SGMLSON wich comes form JASON inspiration... This is about embedding your variables into SGML comments. Is useful to receive via AJAX complex structures. Format is trivial, parser is trivial: function parseSGEMILSON(d,q) { /* format: <!--SGEMILSON::variable_name::variable_value--> explanation: Everything is a string, and there exists no pre evaluation, which means you can use the value returned to parseInt(...), or decide to maintain it as a string containing line feeds, so without ecma errors... or even use this variables to transmit JASON structures. */ var idx1, idx2, expr1; expr1 = "<!--SGEMILSON::"+q+"::"; idx1 = d.indexOf(expr1); if(idx1 >= -1) { idx2 = d.indexOf("-->",idx1+expr1.length); if(idx2 >= -1) { return d.substring(idx1+expr1.length,idx2); } }
}
|
 |
 |
 |
 |
|