Skip to content

Import only the module browser.ajax ? #2178

Closed Answered by PierreQuentel
BobSquarePants asked this question in Q&A
Discussion options

You must be logged in to vote

I could not reproduce the issue. Here are the steps I took:

  1. install Brython in an empty directory (brython-cli install)
  2. delete demo.html (otherwise brython_modules.js has all the stdlib scripts needed by demo.html)
  3. replace the content of index.html by
<!doctype html>
<html>

<head>
<meta charset="utf-8">
<script type="text/javascript" src="brython.js"></script>
<script type="text/javascript" src="brython_stdlib.js"></script>
<script type="text/python" src="test.bry"></script>
</head>

<body onload="brython(1)">
</body>

</html>
  1. put this in test.bry
from browser import window, alert, document, ajax
print('Ajax module', ajax)
  1. for testing, run brython-cli start_server 8001, then load ht…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@BobSquarePants
Comment options

@BobSquarePants
Comment options

Answer selected by BobSquarePants
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants