Your syntax for $.get is wrong. What exactly does generate.cfm return?

--Erik

On 6/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Thanks for the tips!

Actually I am trying to create a list of pictures, not replace the
image.  I am thinking something like this but it is failing:

$('#files_list').after($.get('generate.cfm'));

Must be something small...


On Jun 4, 1:03 am, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> Hard to say for sure without seeing the code. Sounds like you're
> appending a new image element? You could instead just update the src
> attribute of the image tag in question:
>
> <img id="the_image" src="original_image.png"/>
>
> var newImageURL = 'new_image.png'; // load new image URL from somewhere
> $('#the_image').attr('src', newImageURL);
>
> --Erik
>
> On 6/3/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm pretty sure it can since jquery is so sweet, but here's what I am
> > trying to do:
>
> > I have a page (call it generator.cfm) that pulls random pictures from
> > a database.
>
> > I want a button or link I can click on and have it pull from that url,
> > and display in the div or whatever.  pretty simple ajax stuff.
>
> > But the tricky part is if I continue to click on the button it doesnt
> > replace the existing picture, it just appends on the next picture to
> > the list each time the button is clicked.
>
> > Any of you guru's care to help me figure this out?


Reply via email to