Archive for May, 2006 Next Entries »

IE synchronious loading

Wednesday, May 10th, 2006

First of all let’s explain loading scripts synchroyous problem.
This problem occurs when You have several libraries holding JS code, and You are trying to call some function/method/property from another file which is not yet loaded.
So fi You have:

….
And You are trying to call some function from script2 within script 1, or main html/js file it […]

Debugging tips

Wednesday, May 10th, 2006

Make sure all paths are correct
Make sure libraries are loaded
Make sure code is nicely structured
Make sure namespaces are devided

!DO ME proper way to include JS file

Monday, May 8th, 2006

Including one JS file in another will be, like reading other file, as a text file, and when file is loaded, run eval on that code…
This website has loader codes for several browsers, so JS should be done for this…
http://www.rgagnon.com/jsdetails/js-0034.html

Way to include JS files / CSS files differently / apply fixes due to browser incompatibilities

Monday, May 8th, 2006

IE specific comment code

PHP-Like javascript including function

Monday, May 8th, 2006

http://www.phpied.com/javascript-include/

Writing bookmarklets

Wednesday, May 3rd, 2006

Bookmarklet with anticache:
javascript:prefFile=’’;rand_no = Math.random();void(z=document.body.appendChild(document.createElement(’script’)));void(z.language=’javascript’);void( z.type=’text/javascript’);void(z.src=’http://localhost:8880/dev/js/anchorpoints.js?dg=’%2brand_no);
Loading other scripts (from inside the page’s JS with anticache)
someBaseUrl = “http://192.168.2.171:8880″;
function loadScriptSynchronous(scriptUrls, index)� {
var idx = index || 0;
if (scriptUrls.length-1 < idx) {
return;
}
var srcEl = document.createElement(’script’);
srcEl.language=”Javascript”;
srcEl.type=”text/javascript”;
srcEl.src= SomeBaseUrl + scriptUrls[scriptUrls.length-idx-1] + “?rand=”+Math.random();� //this is loading scripts with anticache code
srcEl.onload = (loadScriptSynchronous(scriptUrls, idx+1));
document.body.appendChild(srcEl);
}
var scriptUrls = [”/dev/js/SomeCommon.js”,”/dev/js/SomePrivateContentBase.js”,”/dev/js/jquery.js”,”/Some/dwr/interface/Somecontent.js”,”/Some/dwr/engine.js”];
loadScriptSynchronous(scriptUrls);
Keywords:
Preventing cache, no cahche […]

JQUERY tester

Wednesday, May 3rd, 2006

JQUERY tester

Javascript web 1.0 -> web 2.0 jquery converter in PHP with behaviors

Wednesday, May 3rd, 2006

dsds

Javascript debug

Wednesday, May 3rd, 2006

It’s pain in the ass
Me and arp

Javascript multidimensional objects

Wednesday, May 3rd, 2006

Here are few ways of how to handle objects in javascript
Creating a multidimensional (path like) acessing object:
var ret = new Object();
ret.a = new Object();
ret.a.b= new Object();
ret.a.b.c=”aaaaa”;
//SomeDebug(jsRetStruct);
alert(”valueee:”+ret.a.b.c);
Creating an object and acessing it, assiging variables different way:
Example 1:
retValuesOfKeys[’someID’]=’222222′;
Example 2:
for( x in str.VALUES) {
alert(str.VALUES[x].VAL1);
alert(str.VALUES[x].VAL@);
if(str.VALUES[x].VAL3) alert(str.VALUES[x].VAL3);
if(str.VALUES[x].VAL4) alert(str.VALUES[x].VAL4);
i++;
To be honest I don’t understand this very well…

Next Entries »