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 删除虚拟显示器驱动 删除所有 Xorg 配置文件 删除显示器缓存文件 重启系统 可是依旧无法退出虚拟显示器
  • ¥15 vscode程序一直报同样的错,如何解决?
  • ¥15 关于使用unity中遇到的问题
  • ¥15 开放世界如何写线性关卡的用例(类似原神)
  • ¥15 关于并联谐振电磁感应加热
  • ¥15 this signal is connected to multiple drivers怎么解决
  • ¥60 请查询全国几个煤炭大省近十年的煤炭铁路及公路的货物周转量
  • ¥15 请帮我看看我这道c语言题到底漏了哪种情况吧!
  • ¥60 关机时蓝屏并显示KMODE_EXCEPTION_NOT_HANDLED,怎么修?
  • ¥66 如何制作支付宝扫码跳转到发红包界面