When I press map on my html page it needs to call a function
When I press map on my html page, it needs to call a function form my javascript code in order to put a image on a new, blank webpage(named page). How do i do this? Don\'t output the image onto the current page, it needs to be inside the new page. Thanks! here is html code:
<tr>
<td> Maps</td>
<td> Display a pinpoint location of Akron\'s campus</td>
<td> <button onclick = \"location()\">map</button></td>
</tr>
and here is javascript code:
function location(){ //can\'t get image to show in new webpage
page += <img src=\\\"test.png\";
}
Solution
<tr>
<td> Maps</td>
<td> Display a pinpoint location of Akron\'s campus</td>
<td> <button onclick = \"show()\">map</button></td>
</tr>
The javascript function is as follows:
function show(){ //can\'t get image to show in new webpage
//open the new page to print the image
var new_page = window.open();
new_page.document.write(\"<img src=\\\"test.png\\\">\");
}
use the function with name other than location.
