I have one file (master) that calls another file (loaded) with jquery .load().
In loaded file, javascrips works, but jsx code gets ignored.
Is it possible to load jsx code this way? If it is, how?
If not, what alternatives we have - how to process jsx code in loaded files?
Code of master page:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>React</title>
<script src="https://fb.me/react-with-addons-0.13.2.js"></script>
<script src="https://fb.me/JSXTransformer-0.13.2.js"></script>
<script src="https://code.jquery.com/jquery-1.10.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#loaded").load("loaded.html", function(responseText, textStatus, req) {});
});
</script>
</head>
<body>
<p>Master page</p>
<div id="loaded"></div>
</body>
</html>
Code of loaded page:
<script type="text/javascript">
console.log("JQUERY WORKS");
</script>
<script type="text/jsx">
console.log("REACT WORKS");
</script>
<p>loaded page</p>
Edit: What am I trying to accomplish: I'm working on a web app, that loads its "page fragments" with jquery load, and I need to render a React component inside that fragment.