jQuery, Add / Delete elements without page refresh |
[eluser]Chris Newton[/eluser]
Yes, the script tag is called immediately above the jquery delete script. It looks like the forum stripped out the script tags, so it makes it a bit confusing. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[eluser]xwero[/eluser]
[quote author="mahuti" date="1194395902"] Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> I've added 2 lines that should make it work.
[eluser]Chris Newton[/eluser]
*sigh* omg.... you don't know how many different things I've thought of over the last week. That worked like a charm. It's ALWAYS the little things. Thank you so much man! Awesome!
[eluser]jafarsalam[/eluser]
Thank you so much man! Awesome![/quote] I'm new to php and found this could be helpfully to me. I would like to be able to display file names from a directory and be able to delete/download them. any help would be appreciated. jeff
[eluser]Natebot[/eluser]
Jeff, Codeigniter has got your back (as usual). Listing the files located in a directory is a snap. Consult the user guide's section on the file helper http://ellislab.com/codeigniter/user-gui...elper.html Code: get_filenames('path/to/directory/') returns an array of file names. Just use a foreach loop to step through the array to create your list of links. Deleting them can be done like you did above with an ajax call to another controller method and pass the file's name. Just make sure you control where the script is unlinking files - you don't want the user deleting files elsewhere on your server!
[eluser]jafarsalam[/eluser]
Hi Grad; Wow,thanks for the quick reply. is there a place where I can download the complete set of scripts scripts and uploaded it to my server . thanks jeff |
Welcome Guest, Not a member yet? Register Sign In |