CodeIgniter Forums
Something about ajax with jquery ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Something about ajax with jquery ? (/showthread.php?tid=33834)



Something about ajax with jquery ? - El Forum - 09-09-2010

[eluser]Mr.CodeIgniter[/eluser]
i use ajax with jquery library

and i need to put ajax result in <div> .
Code:
$.get("&lt;?=$CI->config->item('base_url')?&gt;/RegAjax/NewTab/"+tab_counter, function(data){
    $("#tabs-"+tab_counter).append(data);
});

if you see the code in {function(data...etc} i want get ( tab_counter ) from out
the function.
how i can do it.


Something about ajax with jquery ? - El Forum - 09-10-2010

[eluser]Georgi Budinov[/eluser]
Can you show us where do you define tab_counter? In order to access it like this you will have to define that in the global with:

var tab_counter = 0;