php - Load iframe content on button click from another iframe -


i have main.php file contains 2 iframes: test1 , test2

<iframe id="test1" name="test1" src="test1.php" height="300" width="200"></iframe>  <iframe id="test2" name="test2" src="test2.php"></iframe> 

the #test1 contains display: none;

i display content of test1.php when button @ test2.php clicked. have tried number of options , referred previous posts related issue couldn't load test1.php. how can accomplish this?

edit: i'm unsure mean "load". content of other div loaded initially, , you're trying change visibility? or trying change whole contents of iframe?

case 1: if you're trying change visibility of contents loaded in iframe when click button, check question: javascript - element within iframe

once access element wish, can modify display attribute

case 2: if you're trying change whole contents of iframe when click button, need change src attribute. check question answer: changing iframe src javascript


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -