html - same iframe load with other page from iframe jquery event -


   <iframe id="iframe"  style=" width:100%; height:500px" src="other.jsp"  frameborder="0"  name="myone"> <html> <head> <script>  $(function() {                     $("#adduser1").click(function() {                             alert("hiiii");                                          $('#iframe').attr('src', 'adduser.jsp');                     });                  }); </script> </head> <body>             <input type="button" name="adduser" id="adduser1" value="adduser"/>  </body> </html>        </iframe>   

here want load same iframe (its loaded other.jsp ) other jsp adduser.jsp on triggering of inside event of same iframe alerting 'hiiii' not loading jsp page

you trying load iframe button inside iframe, never work way. should use window.location this

$(function() {     $("#adduser1").click(function() {              window.location = 'adduser.jsp'     });  }); 

hope helps :)


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -