2014-12-05 66 views
0
 <span class="input-group-btn"> 
     <button class="btn btn-sm btn-info no-radius" type="submit" onClick="saveMessage('new')" id="query_btn_margin"> 
      <i class="ace-icon fa fa-share"></i> 
       Add Comment 
     </button> 
    </span> 

在对话框中,添加注释后页面重定向到下一页..如何将它固定在同一页面上?如何在评论后重定向到同一页

+1

你的问题不清楚,请解释更 – madforstrength 2014-12-05 06:28:35

+0

2014-12-05 07:05:25

+0

在头section..there是一个消息的电子邮件box..in其收件箱和发领域显示其values..like如果我们想要一个简单的gmail..after写message..then以评论该特定的消息..然后所有评论应显示在同一页面..但在评论后,该页面重定向到主页面(收件箱/发送)页面..我想留在该页面..所以它是如何将工作 ?? – 2014-12-05 07:09:46

回答

0

你已经把这个onclick="saveMessage('new')"功能在函数的末尾添加,

window.location = '/' 

,或者你可以使用这个,

window.location = window.location.host; 
window.location = window.location.href; 

更为您在页面中使用使用jquery,

$(window).attr("location","http://google.com"); 
0

您想转到下一页(下一页p时代内容与显示同一页上:添加评论后无)...

<input type='button' name='add_comment' id='add_comment' value='ADD COMMENT'/> 

当用户点击上面下面的js代码按钮呼叫

$('#add_comment').click(function(){ 
    $('.currentpage_div_id_to_hide').hide(); 
    $('.nextpage_div_id_to_show').show(); 
}); 
2
You can write this code after completing your task,write this line. 
window.location.href = "newjsp.jsp" 
+0

他们都没有工作.. – 2014-12-05 07:19:28

0

试试这个,确保您可以使用.js文件:

<script src="../js/jquery.min.js" ></script> 

<script> 
    $(document).ready(function(){ 
     $("#submitbutton").click(function(){ 
      window.location.href = "newjsp.jsp"; 
     }); 
    }); 
</script>