en son geçen hafta 1.5 den 1.6 ya almışdım scriptaculos u ve site hata vermeye başlamışdı ben draggable objesi kullanıyordum tanımsız manımsız diye ağlıo. kurcalarken kurcalarken buldum.
scriptaculos u head tagına koymak gerekiomuş yoksa patlarmış. ama hack mevcut 49. satırdaki "$$('head script[src]')" satırını "$$('script[src]')" yapıyorsunuz tatlıya bağlanıyor body dede script tagıyla yükleyebilinio.
Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts
Monday, December 01, 2008
Friday, July 18, 2008
yuicompressor batch script
yuicompressor ne diyenlere kısaca anlatim bu dalga js dosyalarımızı obfuscate eder ve sıkıştırır. gereksiz commentleri atar lokal değişken isimlerini değiştirir falan. özünde 100kb lık dosyayı ortalama 80kb a getirebiliyor. tabii her zaman bu geçerli değil ama ortalaması %20 bazen %40 bazen %10 da olabilir o beni bağlamaz.
neyse gelelim bu yazıdaki konuya. XP de komut satırından sıkıştırmaya bakim bakalım nolucak diye uraşıom ama toplam sıkıştırmam gereken css ve js adedi 60. tabii hepsini tek tek komut satırından yapmak büyük sabır istiyor. saolsun google amcam bi kaç örnek bulduruyor. işte bi folderdaki css ve js leri kolayca sıkıştırmanın yolu:
FOR %%G IN (*.css) DO java -jar yuicompressor-2.3.5.jar %%G -o %%G
FOR %%G IN (*.js) DO java -jar yuicompressor-2.3.5.jar %%G -o %%G
bu iki satırı bi bat dosyasına yazın ve komut satırından oluşturduğunuz bat dosyasını çağırın. tabii jar dosyası o folderda olcak bide java path de tanımlı olcak onlar ne nasıl oluyor diyenlere.
bakalım bu 60 dosya çalışcakmı asıl ben onu merak ediyorum.
neyse gelelim bu yazıdaki konuya. XP de komut satırından sıkıştırmaya bakim bakalım nolucak diye uraşıom ama toplam sıkıştırmam gereken css ve js adedi 60. tabii hepsini tek tek komut satırından yapmak büyük sabır istiyor. saolsun google amcam bi kaç örnek bulduruyor. işte bi folderdaki css ve js leri kolayca sıkıştırmanın yolu:
FOR %%G IN (*.css) DO java -jar yuicompressor-2.3.5.jar %%G -o %%G
FOR %%G IN (*.js) DO java -jar yuicompressor-2.3.5.jar %%G -o %%G
bu iki satırı bi bat dosyasına yazın ve komut satırından oluşturduğunuz bat dosyasını çağırın. tabii jar dosyası o folderda olcak bide java path de tanımlı olcak onlar ne nasıl oluyor diyenlere.
bakalım bu 60 dosya çalışcakmı asıl ben onu merak ediyorum.
Friday, March 14, 2008
for loop problem in IE
I was coding some small javascript which should change the tab and modify some color and stuff and load some rss from somewhere its no big deal. somehow code worked in firefox but not in ie7. first I tought I manage to broke variables and naming. look at the code:
function ChangeTab(id,title){
for(k=1;k<4;k++){
if(k==id){
// section 1
}
else
{
// change like it did not choosed
}
}
}
its the simplest code ever. but somehow in ie it did not throw any debug dialog or any error at all. it was breaking the for loop "section 1" if it goes in there. here is the solution:
function ChangeTab(id,title){
for(var k=1;k<4;k++){
if(k==id){
// section 1
}
else
{
// change like it did not choosed
}
}
}
looks like no difference isnt it :) look closer. ie's javascript engine wants that k has to be declared there strange very strange. because normally ie can handle this small things. anyway what is the lesson from here. never trust ie :)
function ChangeTab(id,title){
for(k=1;k<4;k++){
if(k==id){
// section 1
}
else
{
// change like it did not choosed
}
}
}
its the simplest code ever. but somehow in ie it did not throw any debug dialog or any error at all. it was breaking the for loop "section 1" if it goes in there. here is the solution:
function ChangeTab(id,title){
for(var k=1;k<4;k++){
if(k==id){
// section 1
}
else
{
// change like it did not choosed
}
}
}
looks like no difference isnt it :) look closer. ie's javascript engine wants that k has to be declared there strange very strange. because normally ie can handle this small things. anyway what is the lesson from here. never trust ie :)
Subscribe to:
Posts (Atom)
playwright in junie
{ "mcpServers" : { "playwright" : { "command" : "npx" , "args" : [ ...
-
I know its been a long time I have not write anything. because I have not learn or done any new things. I dont want to write regular meaning...
-
in .net 2 if you want to show your application in system tray . you need to add notify icon to your application and set the "ShowInTas...
-
if you have wl11 ejb server and in that environment generated ejb client and deploy to wl12 it will give you this exception java.lang.NoSu...