file_expandosharing.html 827 B

1234567891011121314151617181920212223242526272829303132333435
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script type="application/javascript">
  5. function setup() {
  6. // Set up different target objects for expandos, one for each binding type.
  7. window.targetWN = window;
  8. window.targetDOM = new XMLHttpRequest();
  9. window.targetJS = new Date();
  10. }
  11. function placeExpando(name, val, target) {
  12. target[name] = val;
  13. }
  14. // If val === null, then we shouldn't have access.
  15. function checkExpando(name, val, target, msg) {
  16. if (val !== null) {
  17. ok(name in target, msg);
  18. try {
  19. is(target[name], val, "Got the right expando value");
  20. } catch(e) { ok(false, "Threw when accessing same-origin expando"); }
  21. }
  22. else {
  23. ok(!(name in target), msg);
  24. }
  25. }
  26. </script>
  27. </head>
  28. <body onload="setup();">
  29. <span>Salut, Ma Cherise. ;-)</span>
  30. </body>
  31. </html>