[Proto-Scripty] $$ utility method returns href value instead of anchor tag reference
How come the $$() function returns the value of the href when selecting an anchor tag instead of the tag itself? ...I've had mixed results for this btwn FF and IE6, but it's consistant in the code below. Anyone know what I'm doing wrong here or if there's a workaround? div id=gallery div class=thumb div class=listItem a href=/asdfasdf/asdfsdf.jhtml class=thumbHolderthis is some text/abr / a href=/asdfasdf/asdfsdf.jhtml class=thumbHolderthis is some text/abr / /div /divbr / div class=thumb div class=listItem a href=/asdfasdf/234234.jhtml class=thumbHolderthis is some text 21/abr / a href=/asdfasdf/234234.jhtml class=thumbHolderthis is some text 23/abr / /div /div /div script type=text/javascript var links = $$('.gallery .thumb .listItem .thumbHolder'); alert(links[0]: + links[0]); /script --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Benefits of script.aculo.us OR prototype...
Hi, I am new in AJAX world and want to use Ajax framework for my new project. I am developing web based application where I want to populate forms (Questioner) dynamically through Data base. For following things i need Ajax for: 1. On submitting page, either change questions on form OR change full form with some images or contents. 2. On answering questions create new record/update record in database. I am fresher in this Ajax world, so can you let me know what features Prototype or script.aculo.us provides related to my project? Or I need to add some features if I use one of these frameworks? Also, what advantage these frameworks have over rest of frameworks like DOJO, jquery ext. Thanks for your help with this, Ninad Shaha --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Ajax.Updater home-brew autocompletion timing issue
Matt Foster wrote: [...] To address the wrong order issue, you could create a queue of requests such that each request is asynchronous but stacked such that it will not be sent until the previous request has returned. I've written something for this for prototype 1.5 as Ajax.RequestQueue and formalized this idea in my AgileAjax package in the class AjaxService. I think this is not a good idea for autocompleter purposes. Autocompleter needs to be very fast. If you wait with next request until previous was completed, and, say, that previous request was dropped somewhere in the net, then you will wait long time, a few seconds at least until it will time out. The better approach is to identify each request with some unique id, maybe a serial number, and check if the response you just received is the response for the last sent request. If the responses are deterministic, then parameters of request are sufficient id, if not, then you need a unique identifier. I personally use Ajax.Request for this purpose. I add a serial number to parameters, and, at server side, I put the serial number to the X-JSON: header, along with status (such as error codes, if any, or success indicator etc). Then in the onComplete I check the header only. But this is only possible if you have control over serverside script. I haven't any need to access the request object from the response one, but I always thought it was available as a parameter of the Ajax.Response object [1]. Richard, As for the bug, maybe it's worth submitting the patch again to the Lighthouse [2], as the Trac is used no more. 1. http://prototypejs.org/api/ajax/response 2. http://prototype.lighthouseapp.com/ Best Regards, SWilk --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: behave like Extjs Ajax.request
If you are just concerned with the weight of the ExtJs library, build a version of it which contains just the stuff you need... Seems like if all you need is Ajax, you can build a slimmed down version of ExtJs, and keep your pages the same. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Shrinking JS
After a little playing ove the last couple of days i came up with a nice easy way of shrinking many js files on the fly into 1 file ... this will speed up load time heavily on heavy javascript loaded sites . the code is php and is very simple .. it also uses http://www.crockford.com/javascript/jsmin.html to achieve its goal ... Now i must say in my tests sites with 3 or less large javascript includes this wil not speed up much - infact it wil be slower ... My tests are as follows .. Using Latest Prototype.js Latest Scriptaculous.js Latest Effects.js [phpcode] require($_SERVER['DOCUMENT_ROOT'].'/resources/includes/server/ jsmin.php'); // jsmin $docroot=$_SERVER['DOCUMENT_ROOT']; // array values need changing to reflect your include path(s) $jsArray=array( p=$docroot/resources/includes/client/proto.js, f=$docroot/resources/includes/client/functions.js, s=$docroot/resources/includes/client/scriptaculous.js, e=$docroot/resources/includes/client/effects.js ); $required_js=explode(,,$_GET['load']); foreach($required_js as $reqkey=$reqvalue) { echo JSMin::minify(file_get_contents($jsArray[$reqvalue])); } [/phpcode] Usage: URI - js_load_min.php?load=p,s,e,f will go through the array and find the relevant files, then echo them out into one big file (minified on the fly) - this gets round the 2 requests per domain Async loading issues some people have with multiple CDNS and lots of remote images/includes - it can easily be ported to get the files remotely and some caching of some sort would easily be added ... On my test i loaded 5 javascript files from the same server as the page on thier own and page load was 4 seconds ... after using the above code i got the load time down to averageing 1.5 seconds per refresh. Then testing with only 3 files (prototype,scriptac,effects) the normal load method was around 1.8 seconds on 1st load, then dropped to 0.8 (AVG) per refresh .. while the method above was 1.5 seconds on every load and refresh Someone may find this usefull / interesting and perhaps likes the concept and may want to do something with it, i dont have time at the moment !!! Regards Alex --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: $$ utility method returns href value instead of anchor tag reference
Almost certainly you are seeing the results of a toString() method kicking in for the objects (or similar). Try ... alert(links[0]: + links[0].id + ':' + links[0].href); Richard Quadling. 2009/3/20 tkane2000 tkthomp...@gmail.com: How come the $$() function returns the value of the href when selecting an anchor tag instead of the tag itself? ...I've had mixed results for this btwn FF and IE6, but it's consistant in the code below. Anyone know what I'm doing wrong here or if there's a workaround? div id=gallery div class=thumb div class=listItem a href=/asdfasdf/asdfsdf.jhtml class=thumbHolderthis is some text/abr / a href=/asdfasdf/asdfsdf.jhtml class=thumbHolderthis is some text/abr / /div /divbr / div class=thumb div class=listItem a href=/asdfasdf/234234.jhtml class=thumbHolderthis is some text 21/abr / a href=/asdfasdf/234234.jhtml class=thumbHolderthis is some text 23/abr / /div /div /div script type=text/javascript var links = $$('.gallery .thumb .listItem .thumbHolder'); alert(links[0]: + links[0]); /script -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Shrinking JS
2009/3/20 Jeztah webmas...@thecarmarketplace.com: After a little playing ove the last couple of days i came up with a nice easy way of shrinking many js files on the fly into 1 file ... this will speed up load time heavily on heavy javascript loaded sites . the code is php and is very simple .. it also uses http://www.crockford.com/javascript/jsmin.html to achieve its goal ... Now i must say in my tests sites with 3 or less large javascript includes this wil not speed up much - infact it wil be slower ... My tests are as follows .. Using Latest Prototype.js Latest Scriptaculous.js Latest Effects.js [phpcode] require($_SERVER['DOCUMENT_ROOT'].'/resources/includes/server/ jsmin.php'); // jsmin $docroot=$_SERVER['DOCUMENT_ROOT']; // array values need changing to reflect your include path(s) $jsArray=array( p=$docroot/resources/includes/client/proto.js, f=$docroot/resources/includes/client/functions.js, s=$docroot/resources/includes/client/scriptaculous.js, e=$docroot/resources/includes/client/effects.js ); $required_js=explode(,,$_GET['load']); foreach($required_js as $reqkey=$reqvalue) { echo JSMin::minify(file_get_contents($jsArray[$reqvalue])); } [/phpcode] Usage: URI - js_load_min.php?load=p,s,e,f will go through the array and find the relevant files, then echo them out into one big file (minified on the fly) - this gets round the 2 requests per domain Async loading issues some people have with multiple CDNS and lots of remote images/includes - it can easily be ported to get the files remotely and some caching of some sort would easily be added ... On my test i loaded 5 javascript files from the same server as the page on thier own and page load was 4 seconds ... after using the above code i got the load time down to averageing 1.5 seconds per refresh. Then testing with only 3 files (prototype,scriptac,effects) the normal load method was around 1.8 seconds on 1st load, then dropped to 0.8 (AVG) per refresh .. while the method above was 1.5 seconds on every load and refresh Someone may find this usefull / interesting and perhaps likes the concept and may want to do something with it, i dont have time at the moment !!! Regards Alex http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Shrinking JS
2009/3/20 Richard Quadling rquadl...@googlemail.com: 2009/3/20 Jeztah webmas...@thecarmarketplace.com: After a little playing ove the last couple of days i came up with a nice easy way of shrinking many js files on the fly into 1 file ... this will speed up load time heavily on heavy javascript loaded sites . the code is php and is very simple .. it also uses http://www.crockford.com/javascript/jsmin.html to achieve its goal ... Now i must say in my tests sites with 3 or less large javascript includes this wil not speed up much - infact it wil be slower ... My tests are as follows .. Using Latest Prototype.js Latest Scriptaculous.js Latest Effects.js [phpcode] require($_SERVER['DOCUMENT_ROOT'].'/resources/includes/server/ jsmin.php'); // jsmin $docroot=$_SERVER['DOCUMENT_ROOT']; // array values need changing to reflect your include path(s) $jsArray=array( p=$docroot/resources/includes/client/proto.js, f=$docroot/resources/includes/client/functions.js, s=$docroot/resources/includes/client/scriptaculous.js, e=$docroot/resources/includes/client/effects.js ); $required_js=explode(,,$_GET['load']); foreach($required_js as $reqkey=$reqvalue) { echo JSMin::minify(file_get_contents($jsArray[$reqvalue])); } [/phpcode] Usage: URI - js_load_min.php?load=p,s,e,f will go through the array and find the relevant files, then echo them out into one big file (minified on the fly) - this gets round the 2 requests per domain Async loading issues some people have with multiple CDNS and lots of remote images/includes - it can easily be ported to get the files remotely and some caching of some sort would easily be added ... On my test i loaded 5 javascript files from the same server as the page on thier own and page load was 4 seconds ... after using the above code i got the load time down to averageing 1.5 seconds per refresh. Then testing with only 3 files (prototype,scriptac,effects) the normal load method was around 1.8 seconds on 1st load, then dropped to 0.8 (AVG) per refresh .. while the method above was 1.5 seconds on every load and refresh Someone may find this usefull / interesting and perhaps likes the concept and may want to do something with it, i dont have time at the moment !!! Regards Alex http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! I had to do some minor mods for IE6 to this. But it works REALLY well. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] how to darken a div
Hi, i want to darken a div, but i want to let a window which allow to see an undarken area on my div... Here is an example of what i exactly want to do, but i don't know how to do... http://www.defusion.org.uk/demos/060519/cropper.php?demoType=previewimage=castleformSubmit=Load+demo Thank you for your help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Shrinking JS
Thanks but i wasnt looking to do it, i just had an idea !! Regards Alex - Original Message - From: Richard Quadling rquadl...@googlemail.com To: prototype-scriptaculous@googlegroups.com Sent: Friday, March 20, 2009 11:46 AM Subject: [Proto-Scripty] Re: Shrinking JS 2009/3/20 Richard Quadling rquadl...@googlemail.com: 2009/3/20 Jeztah webmas...@thecarmarketplace.com: After a little playing ove the last couple of days i came up with a nice easy way of shrinking many js files on the fly into 1 file ... this will speed up load time heavily on heavy javascript loaded sites . the code is php and is very simple .. it also uses http://www.crockford.com/javascript/jsmin.html to achieve its goal ... Now i must say in my tests sites with 3 or less large javascript includes this wil not speed up much - infact it wil be slower ... My tests are as follows .. Using Latest Prototype.js Latest Scriptaculous.js Latest Effects.js [phpcode] require($_SERVER['DOCUMENT_ROOT'].'/resources/includes/server/ jsmin.php'); // jsmin $docroot=$_SERVER['DOCUMENT_ROOT']; // array values need changing to reflect your include path(s) $jsArray=array( p=$docroot/resources/includes/client/proto.js, f=$docroot/resources/includes/client/functions.js, s=$docroot/resources/includes/client/scriptaculous.js, e=$docroot/resources/includes/client/effects.js ); $required_js=explode(,,$_GET['load']); foreach($required_js as $reqkey=$reqvalue) { echo JSMin::minify(file_get_contents($jsArray[$reqvalue])); } [/phpcode] Usage: URI - js_load_min.php?load=p,s,e,f will go through the array and find the relevant files, then echo them out into one big file (minified on the fly) - this gets round the 2 requests per domain Async loading issues some people have with multiple CDNS and lots of remote images/includes - it can easily be ported to get the files remotely and some caching of some sort would easily be added ... On my test i loaded 5 javascript files from the same server as the page on thier own and page load was 4 seconds ... after using the above code i got the load time down to averageing 1.5 seconds per refresh. Then testing with only 3 files (prototype,scriptac,effects) the normal load method was around 1.8 seconds on 1st load, then dropped to 0.8 (AVG) per refresh .. while the method above was 1.5 seconds on every load and refresh Someone may find this usefull / interesting and perhaps likes the concept and may want to do something with it, i dont have time at the moment !!! Regards Alex http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! I had to do some minor mods for IE6 to this. But it works REALLY well. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Shrinking JS
2009/3/20 Alex Mcauley webmas...@thecarmarketplace.com: Thanks but i wasnt looking to do it, i just had an idea !! Regards Alex - Original Message - From: Richard Quadling rquadl...@googlemail.com To: prototype-scriptaculous@googlegroups.com Sent: Friday, March 20, 2009 11:46 AM Subject: [Proto-Scripty] Re: Shrinking JS 2009/3/20 Richard Quadling rquadl...@googlemail.com: 2009/3/20 Jeztah webmas...@thecarmarketplace.com: After a little playing ove the last couple of days i came up with a nice easy way of shrinking many js files on the fly into 1 file ... this will speed up load time heavily on heavy javascript loaded sites . the code is php and is very simple .. it also uses http://www.crockford.com/javascript/jsmin.html to achieve its goal ... Now i must say in my tests sites with 3 or less large javascript includes this wil not speed up much - infact it wil be slower ... My tests are as follows .. Using Latest Prototype.js Latest Scriptaculous.js Latest Effects.js [phpcode] require($_SERVER['DOCUMENT_ROOT'].'/resources/includes/server/ jsmin.php'); // jsmin $docroot=$_SERVER['DOCUMENT_ROOT']; // array values need changing to reflect your include path(s) $jsArray=array( p=$docroot/resources/includes/client/proto.js, f=$docroot/resources/includes/client/functions.js, s=$docroot/resources/includes/client/scriptaculous.js, e=$docroot/resources/includes/client/effects.js ); $required_js=explode(,,$_GET['load']); foreach($required_js as $reqkey=$reqvalue) { echo JSMin::minify(file_get_contents($jsArray[$reqvalue])); } [/phpcode] Usage: URI - js_load_min.php?load=p,s,e,f will go through the array and find the relevant files, then echo them out into one big file (minified on the fly) - this gets round the 2 requests per domain Async loading issues some people have with multiple CDNS and lots of remote images/includes - it can easily be ported to get the files remotely and some caching of some sort would easily be added ... On my test i loaded 5 javascript files from the same server as the page on thier own and page load was 4 seconds ... after using the above code i got the load time down to averageing 1.5 seconds per refresh. Then testing with only 3 files (prototype,scriptac,effects) the normal load method was around 1.8 seconds on 1st load, then dropped to 0.8 (AVG) per refresh .. while the method above was 1.5 seconds on every load and refresh Someone may find this usefull / interesting and perhaps likes the concept and may want to do something with it, i dont have time at the moment !!! Regards Alex http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! I had to do some minor mods for IE6 to this. But it works REALLY well. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! No problem. Just saving you becoming a wheel maker. The one I linked to uses gzip to compress the files and then caches them on the server. That way, whenever a change is made, everyone gets a new pre-cached compressed file. No need to re-compress it. This means the actual transfer goes from many hits to none, once cached. It works really well on our intranet (IE6, IE7, FF, Chrome, Safari, Opera - Windows, Linux desktop and Macs). Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Ajax.Updater home-brew autocompletion timing issue
as a bonus, in the case of my problem, I don't even need to tag requests with a uniqid or serial, as I know that I'm only interested in responses to requests where the search string was the same as the current form field value. On Mar 20, 9:26 am, Szymon Wilkołazki wilkola...@gmail.com wrote: The better approach is to identify each request with some unique id, maybe a serial number, and check if the response you just received is the response for the last sent request. If the responses are deterministic, then parameters of request are sufficient id, if not, then you need a unique identifier. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Shrinking JS
ahh !! .. mine has mod_defalte and zlib compression all on the server anyway so i didnt need to !! ... I did notice that his method doesnt minify the files ... Each to their own Alex - Original Message - From: Richard Quadling rquadl...@googlemail.com To: prototype-scriptaculous@googlegroups.com Sent: Friday, March 20, 2009 1:30 PM Subject: [Proto-Scripty] Re: Shrinking JS 2009/3/20 Alex Mcauley webmas...@thecarmarketplace.com: Thanks but i wasnt looking to do it, i just had an idea !! Regards Alex - Original Message - From: Richard Quadling rquadl...@googlemail.com To: prototype-scriptaculous@googlegroups.com Sent: Friday, March 20, 2009 11:46 AM Subject: [Proto-Scripty] Re: Shrinking JS 2009/3/20 Richard Quadling rquadl...@googlemail.com: 2009/3/20 Jeztah webmas...@thecarmarketplace.com: After a little playing ove the last couple of days i came up with a nice easy way of shrinking many js files on the fly into 1 file ... this will speed up load time heavily on heavy javascript loaded sites . the code is php and is very simple .. it also uses http://www.crockford.com/javascript/jsmin.html to achieve its goal ... Now i must say in my tests sites with 3 or less large javascript includes this wil not speed up much - infact it wil be slower ... My tests are as follows .. Using Latest Prototype.js Latest Scriptaculous.js Latest Effects.js [phpcode] require($_SERVER['DOCUMENT_ROOT'].'/resources/includes/server/ jsmin.php'); // jsmin $docroot=$_SERVER['DOCUMENT_ROOT']; // array values need changing to reflect your include path(s) $jsArray=array( p=$docroot/resources/includes/client/proto.js, f=$docroot/resources/includes/client/functions.js, s=$docroot/resources/includes/client/scriptaculous.js, e=$docroot/resources/includes/client/effects.js ); $required_js=explode(,,$_GET['load']); foreach($required_js as $reqkey=$reqvalue) { echo JSMin::minify(file_get_contents($jsArray[$reqvalue])); } [/phpcode] Usage: URI - js_load_min.php?load=p,s,e,f will go through the array and find the relevant files, then echo them out into one big file (minified on the fly) - this gets round the 2 requests per domain Async loading issues some people have with multiple CDNS and lots of remote images/includes - it can easily be ported to get the files remotely and some caching of some sort would easily be added ... On my test i loaded 5 javascript files from the same server as the page on thier own and page load was 4 seconds ... after using the above code i got the load time down to averageing 1.5 seconds per refresh. Then testing with only 3 files (prototype,scriptac,effects) the normal load method was around 1.8 seconds on 1st load, then dropped to 0.8 (AVG) per refresh .. while the method above was 1.5 seconds on every load and refresh Someone may find this usefull / interesting and perhaps likes the concept and may want to do something with it, i dont have time at the moment !!! Regards Alex http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! I had to do some minor mods for IE6 to this. But it works REALLY well. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! No problem. Just saving you becoming a wheel maker. The one I linked to uses gzip to compress the files and then caches them on the server. That way, whenever a change is made, everyone gets a new pre-cached compressed file. No need to re-compress it. This means the actual transfer goes from many hits to none, once cached. It works really well on our intranet (IE6, IE7, FF, Chrome, Safari, Opera - Windows, Linux desktop and Macs). Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Shrinking JS
2009/3/20 Alex Mcauley webmas...@thecarmarketplace.com: ahh !! .. mine has mod_defalte and zlib compression all on the server anyway so i didnt need to !! ... I did notice that his method doesnt minify the files ... Each to their own Alex - Original Message - From: Richard Quadling rquadl...@googlemail.com To: prototype-scriptaculous@googlegroups.com Sent: Friday, March 20, 2009 1:30 PM Subject: [Proto-Scripty] Re: Shrinking JS 2009/3/20 Alex Mcauley webmas...@thecarmarketplace.com: Thanks but i wasnt looking to do it, i just had an idea !! Regards Alex - Original Message - From: Richard Quadling rquadl...@googlemail.com To: prototype-scriptaculous@googlegroups.com Sent: Friday, March 20, 2009 11:46 AM Subject: [Proto-Scripty] Re: Shrinking JS 2009/3/20 Richard Quadling rquadl...@googlemail.com: 2009/3/20 Jeztah webmas...@thecarmarketplace.com: After a little playing ove the last couple of days i came up with a nice easy way of shrinking many js files on the fly into 1 file ... this will speed up load time heavily on heavy javascript loaded sites . the code is php and is very simple .. it also uses http://www.crockford.com/javascript/jsmin.html to achieve its goal ... Now i must say in my tests sites with 3 or less large javascript includes this wil not speed up much - infact it wil be slower ... My tests are as follows .. Using Latest Prototype.js Latest Scriptaculous.js Latest Effects.js [phpcode] require($_SERVER['DOCUMENT_ROOT'].'/resources/includes/server/ jsmin.php'); // jsmin $docroot=$_SERVER['DOCUMENT_ROOT']; // array values need changing to reflect your include path(s) $jsArray=array( p=$docroot/resources/includes/client/proto.js, f=$docroot/resources/includes/client/functions.js, s=$docroot/resources/includes/client/scriptaculous.js, e=$docroot/resources/includes/client/effects.js ); $required_js=explode(,,$_GET['load']); foreach($required_js as $reqkey=$reqvalue) { echo JSMin::minify(file_get_contents($jsArray[$reqvalue])); } [/phpcode] Usage: URI - js_load_min.php?load=p,s,e,f will go through the array and find the relevant files, then echo them out into one big file (minified on the fly) - this gets round the 2 requests per domain Async loading issues some people have with multiple CDNS and lots of remote images/includes - it can easily be ported to get the files remotely and some caching of some sort would easily be added ... On my test i loaded 5 javascript files from the same server as the page on thier own and page load was 4 seconds ... after using the above code i got the load time down to averageing 1.5 seconds per refresh. Then testing with only 3 files (prototype,scriptac,effects) the normal load method was around 1.8 seconds on 1st load, then dropped to 0.8 (AVG) per refresh .. while the method above was 1.5 seconds on every load and refresh Someone may find this usefull / interesting and perhaps likes the concept and may want to do something with it, i dont have time at the moment !!! Regards Alex http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! I had to do some minor mods for IE6 to this. But it works REALLY well. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! No problem. Just saving you becoming a wheel maker. The one I linked to uses gzip to compress the files and then caches them on the server. That way, whenever a change is made, everyone gets a new pre-cached compressed file. No need to re-compress it. This means the actual transfer goes from many hits to none, once cached. It works really well on our intranet (IE6, IE7, FF, Chrome, Safari, Opera - Windows, Linux desktop and Macs). Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! That was easy to add in. The main reason I chose not to in the end was that the caching deals with it all anyway. Having the server handle the compression is a good thing too. If you are not in control of the server, then having to do it yourself and dealing with the crap IE6 says is an area where you can have some fun. As for minification, how does that impact on JS debugging? -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to
[Proto-Scripty] Re: Shrinking JS
thats why i minify on the fly , then its just one change in a .htaccess file to change a path and i can have packed or unpacked scripts ! - Original Message - From: Richard Quadling rquadl...@googlemail.com To: prototype-scriptaculous@googlegroups.com Sent: Friday, March 20, 2009 2:52 PM Subject: [Proto-Scripty] Re: Shrinking JS 2009/3/20 Alex Mcauley webmas...@thecarmarketplace.com: ahh !! .. mine has mod_defalte and zlib compression all on the server anyway so i didnt need to !! ... I did notice that his method doesnt minify the files ... Each to their own Alex - Original Message - From: Richard Quadling rquadl...@googlemail.com To: prototype-scriptaculous@googlegroups.com Sent: Friday, March 20, 2009 1:30 PM Subject: [Proto-Scripty] Re: Shrinking JS 2009/3/20 Alex Mcauley webmas...@thecarmarketplace.com: Thanks but i wasnt looking to do it, i just had an idea !! Regards Alex - Original Message - From: Richard Quadling rquadl...@googlemail.com To: prototype-scriptaculous@googlegroups.com Sent: Friday, March 20, 2009 11:46 AM Subject: [Proto-Scripty] Re: Shrinking JS 2009/3/20 Richard Quadling rquadl...@googlemail.com: 2009/3/20 Jeztah webmas...@thecarmarketplace.com: After a little playing ove the last couple of days i came up with a nice easy way of shrinking many js files on the fly into 1 file ... this will speed up load time heavily on heavy javascript loaded sites . the code is php and is very simple .. it also uses http://www.crockford.com/javascript/jsmin.html to achieve its goal ... Now i must say in my tests sites with 3 or less large javascript includes this wil not speed up much - infact it wil be slower ... My tests are as follows .. Using Latest Prototype.js Latest Scriptaculous.js Latest Effects.js [phpcode] require($_SERVER['DOCUMENT_ROOT'].'/resources/includes/server/ jsmin.php'); // jsmin $docroot=$_SERVER['DOCUMENT_ROOT']; // array values need changing to reflect your include path(s) $jsArray=array( p=$docroot/resources/includes/client/proto.js, f=$docroot/resources/includes/client/functions.js, s=$docroot/resources/includes/client/scriptaculous.js, e=$docroot/resources/includes/client/effects.js ); $required_js=explode(,,$_GET['load']); foreach($required_js as $reqkey=$reqvalue) { echo JSMin::minify(file_get_contents($jsArray[$reqvalue])); } [/phpcode] Usage: URI - js_load_min.php?load=p,s,e,f will go through the array and find the relevant files, then echo them out into one big file (minified on the fly) - this gets round the 2 requests per domain Async loading issues some people have with multiple CDNS and lots of remote images/includes - it can easily be ported to get the files remotely and some caching of some sort would easily be added ... On my test i loaded 5 javascript files from the same server as the page on thier own and page load was 4 seconds ... after using the above code i got the load time down to averageing 1.5 seconds per refresh. Then testing with only 3 files (prototype,scriptac,effects) the normal load method was around 1.8 seconds on 1st load, then dropped to 0.8 (AVG) per refresh .. while the method above was 1.5 seconds on every load and refresh Someone may find this usefull / interesting and perhaps likes the concept and may want to do something with it, i dont have time at the moment !!! Regards Alex http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! I had to do some minor mods for IE6 to this. But it works REALLY well. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! No problem. Just saving you becoming a wheel maker. The one I linked to uses gzip to compress the files and then caches them on the server. That way, whenever a change is made, everyone gets a new pre-cached compressed file. No need to re-compress it. This means the actual transfer goes from many hits to none, once cached. It works really well on our intranet (IE6, IE7, FF, Chrome, Safari, Opera - Windows, Linux desktop and Macs). Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! That was easy to add in. The main reason I chose not to in the end was that the caching deals with it all anyway. Having the server handle the compression is a good thing too. If you are not in control of the server, then having to do it yourself and dealing with the crap IE6 says is an area where you can have some fun. As for minification, how does that impact on JS debugging? -- - Richard
[Proto-Scripty] Re: Shrinking JS
2009/3/20 Jeztah webmas...@thecarmarketplace.com: After a little playing ove the last couple of days i came up with a nice easy way of shrinking many js files on the fly into 1 file ... this will speed up load time heavily on heavy javascript loaded sites . the code is php and is very simple .. it also uses http://www.crockford.com/javascript/jsmin.html to achieve its goal ... Now i must say in my tests sites with 3 or less large javascript includes this wil not speed up much - infact it wil be slower ... You should consider a few enhancements: 1. Cache the output file on the disk, and serve it if the source files hadn't changed. Your server will not have to process the files each time, but only when 2. Insert versions of source files to the url, get rid of question mark, use mod_rewrite instead. The browser would request, for example: URI: /loadJs/proto-1603_scripty-182ef_customScripts-rev1234.js And in .htaccess of /loadJs forward all the urls to your js_load_min.php This will give browsers a chance to cache the js files. 3. Add Expires: header, in far future. I usually make it 100 years from now. Combined points 2. and 3. ensures that any user will have to download your js files once and only once, and redownload it only if he cleared his browser cache. The version strings in the URL ensures, that he WILL for sure download a new version if you update the scripts. 4. run a regular expression on all of source files to get /* (c) copyright Comments */ from them, then prepend your minified file with those comments. Not doing that violates most of the open source licenses. GPL for sure, and I'am pretty sure this also applies to MIT and BSD licenses. Implementing all those points will provide a reliable way to serve javascript, always fast and always with correct version, with respect for the authors of the libraries! Richard: For the debugging purposes I do not use minified and consolidated javascript. I have a build process which compresses the js when I commit sources to svn. It consolidates and compress javascript. So, I code and test and debug plain readable files, then commit. Then I test the minified versions on pre-deploy enviroment, but at this point no debugging is required. I then deploy only the minified scripts. Regards, SWilk --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] #readAttribute('class') returns wrong results in IE8 - where is solution?
Hello, I have exactly this problem: http://prototype.lighthouseapp.com/projects/8886/tickets/364-ie8-doesnt-like-readattributeclass I the last comment, Andrew Dupont says: This was fixed a while back when I made all the changes necessary to get the DOM tests passing in IE8. I'm very glad, but where can I find this solution? I'd like to patch library before 1.6.0.4 comes up. I got git clone git://github.com/sstephenson/prototype.git but there is no whole build library in 'dist' dir. Am I missing something? Thank you for your hard work Guys! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: $$ utility method returns href value instead of anchor tag reference
hmm, well, links[0] is returning a string, not the a object, so those will both return null. The question is why does this statement: $$('.gallery .thumb .listItem .thumbHolder'); return the value of href (a string) and not that a object? Thanks! On Mar 20, 6:38 am, Richard Quadling rquadl...@googlemail.com wrote: Almost certainly you are seeing the results of a toString() method kicking in for the objects (or similar). Try ... alert(links[0]: + links[0].id + ':' + links[0].href); Richard Quadling. 2009/3/20 tkane2000 tkthomp...@gmail.com: How come the $$() function returns the value of the href when selecting an anchor tag instead of the tag itself? ...I've had mixed results for this btwn FF and IE6, but it's consistant in the code below. Anyone know what I'm doing wrong here or if there's a workaround? div id=gallery div class=thumb div class=listItem a href=/asdfasdf/asdfsdf.jhtml class=thumbHolderthis is some text/abr / a href=/asdfasdf/asdfsdf.jhtml class=thumbHolderthis is some text/abr / /div /divbr / div class=thumb div class=listItem a href=/asdfasdf/234234.jhtml class=thumbHolderthis is some text 21/abr / a href=/asdfasdf/234234.jhtml class=thumbHolderthis is some text 23/abr / /div /div /div script type=text/javascript var links = $$('.gallery .thumb .listItem .thumbHolder'); alert(links[0]: + links[0]); /script -- - Richard Quadling Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: #readAttribute('class') returns wrong results in IE8 - where is solution?
On Mar 20, 12:09 pm, keemor kee...@gmail.com wrote: Hello, I have exactly this problem:http://prototype.lighthouseapp.com/projects/8886/tickets/364-ie8-does... I the last comment, Andrew Dupont says: This was fixed a while back when I made all the changes necessary to get the DOM tests passing in IE8. I'm very glad, but where can I find this solution? I'd like to patch library before 1.6.0.4 comes up. I got git clone git://github.com/sstephenson/prototype.git but there is no whole build library in 'dist' dir. Am I missing something? Thank you for your hard work Guys! Try again. It should work with today's revision. -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---