Reputation: 1538
I made a game, and I want it to give the map data that is all stored in a map array. I know how to get javascript to print an object or array to the body so it's copy/pastable javascript.
I want to open a new window or tab to show the map data in when you press a button.
Here's what I have for the map loader, then it prints it to the document. http://jsfiddle.net/Tgwizman/Cx2eF/
I simply want it to show this in a new window or tab without having to make a new page.
Upvotes: 1
Views: 153
Reputation: 6779
One way to do this: (make sure pop-ups are enabled)
It automatically opens a new window. I'll let you figure out the button-pressing part.
sampleWindow = window.open("", "myWindow", "location=no,menubar=yes,resizable=yes,scrollbars=yes,height=640,width=800");
sampleWindow.document.writeln(mapExport);
sampleWindow.document.close();
Upvotes: 1