root / trunk / tests / io / test_BrowserIO.html

Revision 7405, 1.5 kB (checked in by jburke, 23 months ago)

(merge from 0.4 branch) References #2366. Change some tests to work with xdomain.

  • Property svn:eol-style set to native
Line 
1<html>
2        <head>
3                <!--[if lt IE 5.5]>
4                <script language="JavaScript" type="text/javascript" src="http://burstproject.org/burst/fix_ecma.js"></script>
5                <![endif]-->
6                <script language="JavaScript" type="text/javascript">
7                        // Dojo configuration
8                        djConfig = {
9                                preventBackButtonFix: false,
10                                dojoIframeHistoryUrl: "../../iframe_history.html", //for xdomain
11                                isDebug: true
12                        };
13                </script>
14                <script language="JavaScript" type="text/javascript" 
15                        src="../../dojo.js"></script>
16                <script language="JavaScript" type="text/javascript">
17                        dojo.require("dojo.io.BrowserIO");
18
19                        function init(){
20                                var initialState = {
21                                        back: function(){
22                                                alert("We are BACK at initial state.");
23                                        },
24                                        forward: function(){
25                                                alert("We are FORWARD at initial state (you should never see this alert.");
26                                        }
27                                };
28
29                                dojo.undo.browser.setInitialState(initialState);
30                               
31                                var bindArgs = {
32                                        url: "test_BrowserIO_data.txt",
33                                        load: function(type, data, evt){
34                                                dojo.debug(data);
35                                                // we could just set mimetype: "text/javascript" to
36                                                // have it auto-eval, but that's not as interesting
37                                                // dj_eval(data);
38                                        },
39                                        backButton: function(){
40                                                alert("we intercepted the back button");
41                                        },
42                                        forwardButton: function(){
43                                                alert("onward ho!");
44                                        },
45                                        changeURL: "foo"+(new Date()).getTime()
46                                };
47                                var canBind = dojo.io.bind(bindArgs);
48                        }
49
50                        dojo.addOnLoad(init);
51                </script>
52        </head>
53        <body>
54                Check your javascript log; the scripts were all loaded in the head.
55        </body>
56</html>
Note: See TracBrowser for help on using the browser.