I use php file with my output function, ie do_header and do_body etc.
In the body function I have three div tags, div 1, div 2, div 3. div 1 holding the other two position on the left and right of the div tag 1.
I have set up some links in div 2 to open a further page from the website to collect information from user.
Rather than open a complete new webpage I want the page to open in div 3 with div 1 and div 2 remaining the same.
I have looked to try and find if this is possible but not found anything, can someone point me in the correct direction of where i can get info on this.
The html header info is held in a php function not part of the function that provides the information for the div tags 1,2 and 3.
2
Answers
You can use an iframe to open the page in the div. I’ll write a minimal code to help you in the correct direction.
Put an iframe html inside your
div-3
:Add an
onclick
event listener to your button/link which will add source to your iframe.Have you tried
iframe
? You can check this iframe example. Especially Iframe – Target for a Link section of the page.