0

在 jquery 移动页面中,我创建了一个链接来动态加载另一个页面:

<a href="advertiser.php" data-role="button" data-inline="true" data-theme="b">Add New Advertiser</a>

当页面被加载时,页面中的 javascript<head>被剥离。

有没有办法让 jquery mobile 保持加载页面的脚本完好无损?

4

3 回答 3

0

如果页面不是很重,那么您可以在同一个文档中创建下一页(要打开),即

 <div data-role="advertiser" id="Login">

并用链接打开它

<a data-role="button" data-transition="slide" data-direction="forward" data-theme="a" href="#advertiser" data-icon="home" data-iconpos="left">Add New Advertiser</a>

这样即使你来回走,你的脚本也不会刷新

于 2012-05-22T07:09:29.877 回答
0

I'm sure there is a way to do exactly what your talking about. I do however believe there is a simpler way to accomplish the same goal. Check out this answer here. It should solve your problem.

于 2012-05-22T01:10:27.790 回答
0

I'm not sure if this will help you because of lack in details. Try to add: data-prefetch to your link.

<a href="prefetchThisPage.html" data-prefetch> ... </a>
于 2012-05-22T00:25:17.640 回答