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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -