1

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.

1 Answer 1

1

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.

http://jsfiddle.net/Cx2eF/3/

sampleWindow = window.open("", "myWindow", "location=no,menubar=yes,resizable=yes,scrollbars=yes,height=640,width=800");
sampleWindow.document.writeln(mapExport);
sampleWindow.document.close();
​
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! Btw, sampleWindow.docuemnt.write() is all I needed, since it's only one line :P

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.