Re: [jQuery] how to load images with jquery ajax?

2006-08-26 Thread Dave Methvin
>> $("").appendTo(this).src( src ).load( f ); > if you replace the main line by: >$("").src( src ).load( f ).appendTo(this); > then the image will display before the alert() fires. The problem with appendTo being last is that IE will leak memory if you set certain attributes (such as

Re: [jQuery] how to load images with jquery ajax?

2006-08-26 Thread Fil
@ John Resig <[EMAIL PROTECTED]> : > With jQuery 1.0, you should be able to write your plugin like this: > $.fn.image = function(src, f){ > return this.each(function(){ > $("").appendTo(this).src( src ).load( f ); > }); > }; > > Helps to make things a little bit simpler. Yes it works too,

Re: [jQuery] how to load images with jquery ajax?

2006-08-26 Thread John Resig
With jQuery 1.0, you should be able to write your plugin like this: $.fn.image = function(src, f){ return this.each(function(){ $("").appendTo(this).src( src ).load( f ); }); }; Helps to make things a little bit simpler. I like the idea of having the callback for image loading - a smart mo

Re: [jQuery] how to load images with jquery ajax?

2006-08-26 Thread Fil
I made it work both in Safari and FF by changing the insertion sequence: $.fn.image = function(src, f){ return this.each(function(){ $("").appendTo(this).each(function(){ this.src = src; this.onload = f; }); }); } $(document).ready(function() { $("#container").im

Re: [jQuery] how to load images with jquery ajax?

2006-08-26 Thread Fil
> Try swapping the order of the lines above to: > > i.onload = f; > i.src = src; > > So that the onload is set before you start loading the image... Not sure > but that may help? Nope, it doesn't. In fact the image loads (as I can see from Safari's "Activity" window), and the alert message pops

Re: [jQuery] how to load images with jquery ajax?

2006-08-26 Thread Kelvin Luck
Fil wrote: > @ SDisk SDisk <[EMAIL PROTECTED]> : >> You can not load images with AJAX simply create a new image object and >> append, then the image can load asyncronously. Try this simple jQuery >> plugin: >> >> $.fn.image = function(src, f){ >>return this.each(function(){ >>var i = ne

Re: [jQuery] how to load images with jquery ajax?

2006-08-26 Thread Fil
@ SDisk SDisk <[EMAIL PROTECTED]> : > You can not load images with AJAX simply create a new image object and > append, then the image can load asyncronously. Try this simple jQuery > plugin: > > $.fn.image = function(src, f){ >return this.each(function(){ >var i = new Image(); >

Re: [jQuery] how to load images with jquery ajax?

2006-08-15 Thread Jason Foss
On 15/08/06, Braveheart <[EMAIL PROTECTED]> wrote: > > > Maybe this is a basic question, but still how can I load images with jquery > and is there any way to use that little animated .gif that shows that > somethink is loading with jquery? > -- > ___ > j

Re: [jQuery] how to load images with jquery ajax?

2006-08-15 Thread SDisk SDisk
Maybe you need learn some of _javascript_ basics and jQuery notation.The plugin normally is in a separate file, althought you can write the plugincode in your program code:in HTML code:  alert("The image is loaded");
  });
});

  2006/8/15, Braveheart <[EMAIL PROTECTED]>: I gues

Re: [jQuery] how to load images with jquery ajax?

2006-08-15 Thread Braveheart
I guess this is what I was looking for. Anyway I don't know almost anything about javaScript and I started using it since I found out about AJAX So can you explain me better for how to implement it? Here is my example how I tried using it: $(document).ready(function(){ // The plugin

Re: [jQuery] how to load images with jquery ajax?

2006-08-15 Thread SDisk SDisk
You can not load images with AJAX simply create a new image object and append, then the image can load asyncronously. Try this simple jQuery plugin:$.fn.image = function(src, f){    return this.each(function(){         var i = new Image();        i.src = "">        i.>        this.appendChild(i);  

Re: [jQuery] how to load images with jquery ajax?

2006-08-15 Thread Curdin Krummenacher
Hey there, have a look at Cody Lindley's thickbox. It sounds like this is more or less what youre after. Im no pro myself, so Im not going to post any code - i might get it wrong :) http://codylindley.com/_javascript_/257/thickbox-one-box-to-rule-them-allcheerscOn 8/16/06, Braveheart < [EMAIL PROTE

[jQuery] how to load images with jquery ajax?

2006-08-15 Thread Braveheart
I stried to use ajax with jquery to load images. Basicly it works but I don't get the image, instead I get some strange codes from the picture, I guess because .jpg is a binary file. Maybe this is a basic question, but still how can I load images with jquery and is there any way to use that littl