web analytics

JavaScript: edit web page in browser

Here is small bookmarklet, which allows to edit the web page for any site (ok, You could save the results on Your local machine only).

javascript:document.body.contentEditable=’true’; document.designMode=’on’; void 0

JavaScript: Soundex implementation

There is a special algorithm for comparision strings, which sound similar (Soundex).

Here is JavaScript Soundex implementation:

function soundex ( s_src ) {      var s_rez = "0000" ;  var new_code, prev, idx    a_codes = { "bfpv": 1, "cgjkqsxz":2, "dt": 3, "l": 4, "mn": 5, "r": 6 };    s_src = s_src.toLowerCase().replace(/ /g,"") […]

JavaScript: build table dynamically

<script type="text/javascript"> function buildTable(n_rows,n_columns) { var the_body = document.getElementsByTagName("body")[0]; <code>var new_table = document.createElement("table"); var new_tbody = document.createElement("tbody"); var new_row, new_col, new_text ; for(row=1;row<=n_rows;row++) { new_row = document.createElement("tr"); new_row.className = "tr"+row ; for(col=1;col<=n_columns;col++) { new_col = document.createElement("td"); new_col.className = "td"+col ; new_text = document.createTextNode("text:" + row + ":" + col ); new_col.appendChild(new_text); new_row.appendChild(new_col); } new_tbody.appendChild(new_row); } […]