echo using jquery

JavaScript related questions should go here.
Post Reply
ashwood
Posts: 144
Joined: Thu May 12, 2011 7:17 am

echo using jquery

Post by ashwood »

I was wondering how i would go about doing this:

basically i want to echo out my results from a table but i want to use jquery as i want to be able to put a x button on each results then if that is clicked the results i removed from the page and also from the database i was thinking delete from the database and on delete refresh div that all the results are echo'd out into? does that make sence?

thanks
ash :)
I would put a signature.. BUT, i don't have the time.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: echo using jquery

Post by jacek »

The fact that you are using JavaScript to add some kind of page effect means nothing.

You can still output data from the database with php,
Image
ashwood
Posts: 144
Joined: Thu May 12, 2011 7:17 am

Re: echo using jquery

Post by ashwood »

yeah i know that.. its the fact when i press delete i want it to disapear like fadeout effect type thing..
I would put a signature.. BUT, i don't have the time.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: echo using jquery

Post by jacek »

So the problem is using the fade method ?

What are you having trouble with ?

I am the wrong person to ask on jQuery things, but I will have a go ;)
Image
ashwood
Posts: 144
Joined: Thu May 12, 2011 7:17 am

Re: echo using jquery

Post by ashwood »

basically right i want to echo out the results like i currently am in php BUT if the user i admin i on hover a delete button will appear i can do that the show if admin the show on hover i cant not yet.. but the main thing is when that delete button is pressed i want that result to fade out and the other results to close in together as to say that result never existed but at the same time as fading out delete that record from the database...
I would put a signature.. BUT, i don't have the time.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: echo using jquery

Post by jacek »

ashwood wrote:but at the same time as fading out delete that record from the database...
That would ave to be done via an ajax request, I have no idea on all the visual stuff, but to make it remove from the db you want to use AJAX :D

Probably want to create a function that does the ajax request, and then shows an error if it fails, or removes the item if not.
function remove_item(item_id){
    // do things
}
Then this function should be called using the onclick event for the X button or what ever you have,
Image
ashwood
Posts: 144
Joined: Thu May 12, 2011 7:17 am

Re: echo using jquery

Post by ashwood »

jacek wrote:
ashwood wrote:but at the same time as fading out delete that record from the database...
That would ave to be done via an ajax request, I have no idea on all the visual stuff, but to make it remove from the db you want to use AJAX :D

Probably want to create a function that does the ajax request, and then shows an error if it fails, or removes the item if not.
function remove_item(item_id){
    // do things
}
Then this function should be called using the onclick event for the X button or what ever you have,


see now i can work with the above and do the fading myself using jquery I THINK its a long shot but im going to have a go.. in that function you provided //do things.. could i not get it to call a php file that has the delete from... in it?
I would put a signature.. BUT, i don't have the time.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: echo using jquery

Post by jacek »

ashwood wrote:in that function you provided //do things.. could i not get it to call a php file that has the delete from... in it?
That's what I meant by things ;)
Image
ashwood
Posts: 144
Joined: Thu May 12, 2011 7:17 am

Re: echo using jquery

Post by ashwood »

jacek wrote:
ashwood wrote:in that function you provided //do things.. could i not get it to call a php file that has the delete from... in it?
That's what I meant by things ;)
should be fairly easy now then :) thanks man
I would put a signature.. BUT, i don't have the time.
Post Reply