I have a page with a button to create a simple report. On click of the button, it calls the back-end program to get the relevant data in a JSON format.
- Upon receiving the data I want to load the following page in a new window/tab,
- Load a fragment of the HTML maintained in a separate html,
- Place it in , and
- Plug the values received from back-end.
If I use window.open("Mypage.html"), it loads the page and shows it in new tab, but then I cannot use $("#report").load("fragment.html") and also I cannot replace values of that fragment.html.
How to solve this problem?
------------------------------
Mypage.html
------------------------------
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<div id="report"></div>
</body>
</html>
--------------------------
fragment.html
--------------------------
<h1>Sample Report</h1>
<h1>name</h1>
<p>Address</p>