0

我有一个非常简单的 html 页面,它呈现为一个对话框。它以以下方式呈现:

<a href = "simple.html" data-rel = "dialog" >

Simple.html 页面在 <head> 标记中具有以下 javascript 代码

<script>
   alert "hello";
</script>

当 simple.html 呈现为对话框时,永远不会弹出警告框。但是,当 simple.html 被呈现时,而不是作为对话框,javascript 会被执行。

在将呈现为对话框的 html 页面中执行/包含 javascript 代码的方法是什么。

编辑:只要在其中,Javascript 就会被执行< div data-role="page" > ........ < /div >

4

2 回答 2

0

在包含 jquery 之后,但在包含 jquery mobile 之前,您必须包含您的自定义 JS。

来源:http: //jquerymobile.com/demos/1.1.1/docs/api/globalconfig.html

于 2012-08-19T01:38:17.997 回答
0

在 simple.html 你必须写data-role="dialog"而不是"page"

于 2012-08-19T07:10:46.033 回答