Home >Backend Development >PHP Tutorial >javascript - $.post和iframe
When the a tag is clicked, get the value of ssss, use the $.post method to access the CI controller, and the controller points to a view. $.post function(data){data is the complete code of a page (verified)}. I want to turn this data into a page and stuff it into an
public function link(){
<code>$hrefs=$this->input->post('hrefs'); $this->load->view($hrefs);</code>
}
How can I turn the value of this data into a page and insert it into an
When the a tag is clicked, get the value of ssss, use the $.post method to access the CI controller, and the controller points to a view. $.post function(data){data is the complete code of a page (verified)}. I want to turn this data into a page and stuff it into an
public function link(){
<code>$hrefs=$this->input->post('hrefs'); $this->load->view($hrefs);</code>
}
How can I turn the value of this data into a page and insert it into an
I thought it would be troublesome to write a connection for each a tag, so is there any simple method, such as getting the connection when clicked, accessing the view through the controller, and printing the view in an
<code>$.post("<?php echo base_url('ceping/c_cp/link')?>",{herfs:hrefs},function(data){ $('#iframeid').html(data); });</code>
Define iframe
Then the ajax request does not return the content of the html page but returns this content. Corresponding request address
$("#test").attr("src",json.url);