[jQuery] Re: can i use .load to return HTML but not inject in to dom?
$.load(../+myModule+/+navTitle+/folders/index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); try that robing wrote: I don't know if this is possible or not but i would like to use the .load method to return the contents of a file but not inject the code in to the dom because i want to use .replaceWith ( returnedLoadData ). here is what i have tried so far and i can return the data to e but the return false isn't preventing the return data from being injected in to #folders. $('#folders').load(../+myModule+/+navTitle+/folders/ index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); does anyone know of a way to do this?
[jQuery] Re: can i use .load to return HTML but not inject in to dom?
Hi Liam, i got $.load is not a function, any other suggestions?? On Jul 29, 9:57 pm, Liam Potter radioactiv...@gmail.com wrote: $.load(../+myModule+/+navTitle+/folders/index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); try that robing wrote: I don't know if this is possible or not but i would like to use the .load method to return the contents of a file but not inject the code in to the dom because i want to use .replaceWith ( returnedLoadData ). here is what i have tried so far and i can return the data to e but the return false isn't preventing the return data from being injected in to #folders. $('#folders').load(../+myModule+/+navTitle+/folders/ index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); does anyone know of a way to do this?
[jQuery] Re: can i use .load to return HTML but not inject in to dom?
then I'd say use the ajax function. http://docs.jquery.com/Ajax/jQuery.ajax#options robing wrote: Hi Liam, i got $.load is not a function, any other suggestions?? On Jul 29, 9:57 pm, Liam Potter radioactiv...@gmail.com wrote: $.load(../+myModule+/+navTitle+/folders/index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); try that robing wrote: I don't know if this is possible or not but i would like to use the .load method to return the contents of a file but not inject the code in to the dom because i want to use .replaceWith ( returnedLoadData ). here is what i have tried so far and i can return the data to e but the return false isn't preventing the return data from being injected in to #folders. $('#folders').load(../+myModule+/+navTitle+/folders/ index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); does anyone know of a way to do this?
[jQuery] Re: can i use .load to return HTML but not inject in to dom?
Thanks Donny, $.get(../+myModule+/+navTitle+/folders/index.php, function (data){ $('#folders').replaceWith(data); //return false; },html); works for me. On Jul 29, 10:15 pm, Donny Kurnia donnykur...@gmail.com wrote: robing wrote: I don't know if this is possible or not but i would like to use the .load method to return the contents of a file but not inject the code in to the dom because i want to use .replaceWith ( returnedLoadData ). here is what i have tried so far and i can return the data to e but the return false isn't preventing the return data from being injected in to #folders. $('#folders').load(../+myModule+/+navTitle+/folders/ index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); does anyone know of a way to do this? .load is actually a wrapping function for .get. You can use .get or even .ajax for more control. -- Donny Kurniahttp://blog.abifathir.comhttp://hantulab.blogspot.comhttp://www.plurk.com/user/donnykurnia
[jQuery] Re: can i use .load to return HTML but not inject in to dom?
robing wrote: I don't know if this is possible or not but i would like to use the .load method to return the contents of a file but not inject the code in to the dom because i want to use .replaceWith ( returnedLoadData ). here is what i have tried so far and i can return the data to e but the return false isn't preventing the return data from being injected in to #folders. $('#folders').load(../+myModule+/+navTitle+/folders/ index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); does anyone know of a way to do this? .load is actually a wrapping function for .get. You can use .get or even .ajax for more control. -- Donny Kurnia http://blog.abifathir.com http://hantulab.blogspot.com http://www.plurk.com/user/donnykurnia
[jQuery] Re: can i use .load to return HTML but not inject in to dom?
Surely $(#folders).replaceWith will actually do the - er - replacing ? L Liam Potter wrote: $.load(../+myModule+/+navTitle+/folders/index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); try that robing wrote: I don't know if this is possible or not but i would like to use the .load method to return the contents of a file but not inject the code in to the dom because i want to use .replaceWith ( returnedLoadData ). here is what i have tried so far and i can return the data to e but the return false isn't preventing the return data from being injected in to #folders. $('#folders').load(../+myModule+/+navTitle+/folders/ index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); does anyone know of a way to do this? No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.35/2270 - Release Date: 07/29/09 06:12:00
[jQuery] Re: can i use .load to return HTML but not inject in to dom?
Try using $.get - it'll return the data From http://docs.jquery.com/Ajax/load : .load : Load HTML from a remote file and inject it into the DOM. HOWEVER : .get : Load a remote page using an HTTP GET request. $.get(../+myModule+/+navTitle+/folders/index.php, { OPTIONAL PARAMETERS HERE }, function(data){ console.log(data); alert(Data Loaded: + data); }); robing wrote: I don't know if this is possible or not but i would like to use the .load method to return the contents of a file but not inject the code in to the dom because i want to use .replaceWith ( returnedLoadData ). here is what i have tried so far and i can return the data to e but the return false isn't preventing the return data from being injected in to #folders. $('#folders').load(../+myModule+/+navTitle+/folders/ index.php, function(e){ console.log(e); $('#folders').replaceWith(e); return false; }); does anyone know of a way to do this? No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.35/2270 - Release Date: 07/29/09 06:12:00