Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- type: "POST",
- url: baseUrl + "profile/setting",
- dataType: 'json',
- success: function(data){
- var html = "";
- html += "<div>";
- html += "<img src="" + baseUrl + data.picture + "" />";
- html += "<div>" + data.email + "</div>";
- html += "<div>" + data.first_name + " " + data.last_name + "</div>";
- html += "<div>" + data.address + "</div>";
- html += "<div><input type="text" class="input_text_top"/></div>";
- html += "<div><input type="text" class="input_text_middle"/></div>";
- html += "<div><input type="text" class="input_text_bottom"/></div>";
- html += "<div><input type="submit" class="btn btn_grey"/></div>";
- html += "</div>";
- $('#result_column').removeAttr('style').html(data);
- }
- });
- $response = $this->load->view("your_ajax_view", $data, TRUE);
- //do anything you would need to with the response.
- echo $response;
- $.ajax({
- type: "POST",
- url: baseUrl + "profile/setting",
- success: function(data){
- $('#result_column').html(data);
- }
- });
- function setting()
- {
- //whatever your code is, but then just pass the json
- //data you were echoing before to the view file
- $data['json_stuff'] = '';//however you generat this
- $this->load->view('some view file', $data);
- return;
- }
Add Comment
Please, Sign In to add comment