dongshanxiao7328 2013-07-01 07:29
浏览 53
已采纳

如何刷新DOM(并在另一个页面上有正确的URL)Jquery-mobile

Good day, I'm learning Jquery mobile and I'm stuck with a simple thing, that maybe should be solved in a minute.

I have made a simple 2 page site, all windows are single HTML PAGES, so I have index.php, contacts.php and sendmail.php (which is only for mailing purposes).

I navigate from index to contacts smoothly, then I fill the form and click submit, the sendmail.php has a header:('location:') that redirect the user to index.php after sending the mail, but when I get back to index.php, the navbar is pointing "sendmail.php" which is not right. is there a way to easy change it (maybe reload a page)? the form action is like this:

<form action="sendmail.php" method="POST">

links from page to another are like: first page:

<script type="text/javascript">
 $( function() {   

  $('body').bind( 'swipe', function( e ) {
    $.mobile.changePage( "contatti.php", {      
       transition: "slide", 
       reverse: true, 
       changeHash: false,
       reloadPage: true      
   });
  } ); 


} );


 </script>

<a data-role="button" data-transition="flip" href="contatti.php" data-icon="info"
        data-iconpos="left" class="ui-btn-right" data-prefetch="true">
            Info
        </a>

and then the action as described, when i get back to the first page, i have the url like this:

/mobile/#/mobile/sendmail.php
  • 写回答

1条回答 默认 最新

  • doushi3202 2013-07-01 07:44
    关注

    You can always modify window.location.hash = '';

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答