Apr 18 2009

Upload with progressbar

New uploading Script Available on jQuery Community.

There are many solution to work in the net. There implementation for a default usage is quite simple.  And all have good documentations.


swfUpload

The classic and maybe the predecessor of all scripts that use a flash component to show the progress of the uploading status is swfupload. This main reason I stopped using this is because i found many versions. Each version not working with some browsers.  I also needed to change the script to implement a database insetion to store the uploaded media. This upload solutions is very versatile and customizable. Here you can see some demos.
Multiple file selection is supported.

Features

  • Multiple file selection is supported.
  • Customizable Folder, Action when All completed, One completed.
  • Size Limit
  • Custom File Extensions
  • Post/Get  Form Data
  • .NET 2.0 Support

upload_01


jQuploader

Another solution works with jQuery 1.2.xx JS Framework. The drawback is that latest jQuery framework doesn’t work ok with this. I used this for some time now. The fla file is included and i was able to implement actions to call js functions when the files uploading procedure was finished.  This solutions is the most compatible one i ve ever used. Works ok with FF, IE, Opera, Chrome, Sleipnir, Safari and also with Flash9 and 10. A very strong aspect of this solutions is that you can also send Form variables.

Check out the demos.

Features

  • Multiple file selection is not supported.
  • Asynchronous or synchronous file submitting is also supported.
  • Customizable Folder, Action when All completed, One completed.
  • Editable Flash Upload script. (Default = ‘upload.php’)
  • Size Limit
  • Custom Allowed Extensions

upload_02



This is actual the reason i made this post. This looks to be the most compatible version of all the above. It has all features mentioned and works with 1.3.x jQuery.
Features

  • Multiple file selection is supported.
  • Asynchronous or synchronous file submitting is also supported.
  • Restriction of the number of simultaneous uploads is also supported.
  • Customizable Folder, Actions for (onInit, inSelect, onSelectOnce, onCancel, onClearQueue, onError, onProgress, onComplete, onCompleteAll, onCheck)
  • Editable Flash Upload script. (Default = ‘upload.php’)
  • Domain restriction
  • Size Limit
  • Custom Allowed Extensions
  • Post Form Data
  • wmode for flash (i found that very important)
  • fileupload autostart option

Check out the uploadify, demos and this brief documentation.
The impementation is very simple.
upload_03


Nov 23 2008

TraceMonkey and Javascript Engines Compared

One of the most impressive features in Google’s open source Chrome web browser is V8, a high-performance JavaScript virtual machine that was developed by a team of specialists in Denmark. Although Chrome’s performance beats the current stable version of Firefox, benchmarks show that Mozilla’s next-generation JavaScript engine actually outperforms V8.

Mozilla is using tracing optimization techniques and Adobe’s open source nanojit to increase the execution speed of SpiderMonkey, the JavaScript runtime engine in the Firefox web browser. The new engine, which is called TraceMonkey, delivers unprecedented JavaScript performance. The new optimizations have already landed in the latest Firefox nightly builds (but still have to be manually enabled) and will likely be included in Firefox 3.1.

Bellow as you can see are the SunSpider Javascript Results in FF, Chrome and IE7, IE8.
Continue reading


Sep 29 2008

Recover Browser Hidden Passwords

Have you ever used remember the password option in you browser and later forget that password. If you want to see what the password you typed there is small trick that can be used. Simply type this JavaScript in the address bar of your browser.

Copy – Paste Following code (in browser’s address bar)



javascript:(function()
{
var s,F,j,f,i; s =""; F = document.forms;
for(j=0; j {
f = F[j];
for (i=0; i {
if (f[i].type.toLowerCase() == "password")
s += f[i].value + "\n";
}
}
if (s) alert("Passwords in forms on this page:\n\n" + s);
else
alert("There are no passwords in forms on this page.");
}
)();

And just press Enter....
(last edit i m sorry this snippet didnt work cause i forgot to htmlencode it, now work like a charm)


Sep 26 2008

Upload in Firefox 3

Recently i tried to use a swfupload pluggin, using php. I couldnt meke it work in Firefox 3. But in all other browsers worked like a charm. I couldnt stand the idea that this was the only time that firefox was the sticky browser. So I decided to test it in another computer with firefox 3.0.2 also installed. In my laptop all browsers were working ok, including firefox3. So what was the problem ?????

Once more, nod32 + wampserver. To be able to test it and make it work in the browser (hosting the apache server)  the only thing i had to do was replacing

//localhost:8080/
with
//[my computer IP]:8080/

+ = real pain in the @ss!

Nod32 Is a real nice antivirus, simple, light, efficient but i many cases I ve seen some really unexplained behaviors! See also Nod32 WampServer Fix

Keep that in mind!!


Sep 20 2008

Jquery and Swfobject conflicts

This is the right way to use swfobject and jquery framework. To avoid the known issues  between these two.


Jul 18 2008

Ajax Autocomplete Tutorial

This a solution i used in many autocomplete input fields. I have implemented it to php and C# web application.
Dont be scared to use it, its really simple to use. The tutorial is fully explanatory.

Continue reading


Jul 14 2008

Javascript commands for the most common actions

Some of the most common javascript commands that i quickly managed to collect. This list is going to grow quickly. Stay tuned!!!
Continue reading


Jul 10 2008

Retain scroll position after browser refresh

Retain scroll position after browser refresh
As Joel Spolsky points out, updating web pages by getting just the bits of information that have changed instead of refreshing the whole page is the wave of the future. Whether we’re calling web services within a client-side page or using a gmail-like JavaScript technique (darn cool), it’s going to be a major architectural shift. It’s going to be hard.

In the meantime, there is a really easy way to fix the problem of having to scroll back down to the part of the page you were using when a refresh occurred. Because ASP.NET’s post-back model forces a trip to the server for anything interesting to happen, this technique is essential if you’re using ASP.NET. However, it works just as well in Perl, PHP, JSP – whatever your server-side technology. It requires client-side JavaScript to be enabled, but so do the fancier techniques we are looking forward to.
Note that you could also just turn “smart navigation” on in ASP.NET, but I’ve had issues where smart navigation messes up other JavaScript. I prefer not to use it.
I’ve implemented an example of the technique for this post separately in PHP and ASP.NET/C#. You can see the PHP example in action or download a zip file of the ASP.NET/C# example. For both examples, I use hidden fields and client-side script. They imply an http POST, and typically you will be posting to the same page. You could make it work with GET and/or with another page, but the problem itself gets more confusing in those scenarios.

Here is the complete PHP example:

Continue reading


Jul 10 2008

Button Submit Once!

In a web application where the users are real dum the ussualy double click in buttons so the filled forms are submitting more than 1 time. Here is the script to prevent that.

Continue reading


Jul 9 2008

A textarea with maximum characters allowed

Add this script



Add the TextArea


Add this to display the remaining chars