Create a function that gets data from a specific page

FOrUmlisT

New Member
I have had problems with this all day and can't find a solution. I need to create a function that gets data from a specific page. The id on the page needs to be passed on to the function. When I first try \[code\]alert(value)\[/code\], it works, but the next time I insert it into .ajax url, it doesen't work. What can be the problem?\[code\]<script> function func(value){ alert(value); //WORKS FINE, alertbox with content "1" appears. $.ajax( { type:'GET', url:'<?=site_url("page/view/" + value);?>', //DOES NOT WORK, when i enter "page/view/1" it works. When i enter "page/view/ + value" it does not work. success: function(data){ alert(data); } } ); } $(document).ready(function() {});</script> \[/code\]
 
Back
Top