You don't have to escape everything. Only the <script> tags.
anyway, this is not really a Google Maps API question, but plain
javascript.
Take a look at some of these links:
http://www.google.com/search?hl=en&q=script+tag+inside+document.write&btnG=Google+Search&aq=0&oq=script+tag+inside+

--
Marcelo - http://maps.forum.nu
--


On Jan 27, 8:01 pm, Chris_H <[email protected]> wrote:
> Tried that
>
> Here is the code running on the site at the moment with the
> formtest.php
>
> function preview(form) {
>         popup = window.open('
> ','MapPreview','height=600,width=600,scrollbars=1,resize=1');
>         if(window.focus) { popup.focus() }
>         popup.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
> Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>');
>         popup.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml";
> xmlns:v="urn:schemas-microsoft-com:vml">');
>         popup.document.writeln('<head><title>Map preview<\/title>');
>         popup.document.writeln('<script type="text/javascript" src="http://
> maps.google.com/maps?
> file=api&v=2&key=ABQIAAAAxU8MgDckrHJTfJRpzOnO9xRpiCodnJXNm6PcpGXBaY1r2oxQRhToiK0CBK6GX7XZvVEXrdKdxCOR4w"><
> \/script>');
>         popup.document.writeln('<script language="JavaScript" src="scripts/
> jscripts/mapbuild.js"><\/script>');
>         popup.document.writeln('<\/head><body onload="popup_initialize()"
> onunload="GUnload()" >');
>         popup.document.writeln('<div id="container"><div id="content"><div
> id="main">');
>         popup.document.writeln('<div id="comment"><br\/><p><font
> color="grey">The following information will be shown in the Event
> Listing pages.<\/font><\/p><\/div>');
>         popup.document.writeln('<p>Name '+form.contact.value+'<\/p>');
>         popup.document.writeln('<p>Address '+form.theaddress.value+'<\/p>');
>         popup.document.writeln('<input type="hidden" id="address"
> name="address" value="'+form.theaddress.value+'">');
>         // build the map
>         popup.document.write('<hr><br\/>');
>         popup.document.writeln('<h4>Map of your location<\/h4><br\/>');
>         popup.document.writeln('<p>The following map will be shown if the
> address you have entered can be mapped correctly.  If the map is not
> what you expect to see you may have to alter the address to correct.<\/
> p>');
>         popup.document.writeln('<div id="my_map_canvas" style="width: 500px;
> height: 300px;"><\/div>');
>         popup.document.writeln('<br\/>');
>         popup.document.writeln('<p><input type="button"
> onClick="javascript:self.close()" value="Close"><\/p>');
>         popup.document.writeln('<\/div><\/div><\/div><\/div><\/div>');
>         popup.document.writeln('<\/body><\/html>');
>         popup.document.close();
>         }
>
> The GUnload could be because the script has not loaded, it seems to
> fail before anything happens?
> If you run this on Firefox I see an error when trying to incorrectly
> add a marker text (address) but thats all?
>
> On Jan 27, 1:29 pm, marcelo <[email protected]> wrote:
>
> > The API never gets loaded in the popup, and you should be able to see
> > that because when you close the popup window you get "GUnload() is not
> > defined."
> > See this:http://www.faqts.com/knowledge_base/view.phtml/aid/841
>
> > --
> > Marcelo -http://maps.forum.nu
> > --
>
> > On Jan 27, 7:26 pm, Chris_H <[email protected]> wrote:
>
> > > Just as an update I did try to get the passing of the page name to the
> > > popup to work again but it doesn't!  Do not know how I got it to work
> > > before?
>
> > > Chris...
>
> > > On Jan 27, 1:12 pm, Chris_H <[email protected]> wrote:
>
> > > > Not sure if anyone understood the last post so here is the url 
> > > > again.http://www.shieldadvanced.ca/formtest.php
>
> > > > On Jan 27, 12:41 pm, Chris_H <[email protected]> wrote:
>
> > > > > The page is formtest.php?
>
> > > > > Somehow got removed from post or I forgot it!
>
> > > > > On Jan 27, 12:31 pm, marcelo <[email protected]> wrote:
>
> > > > > > On Jan 27, 6:28 pm, Chris_H <[email protected]> wrote:
>
> > > > > > >http://www.shieldadvanced.ca/formtest
>
> > > > > > 404. :-(
>
> > > > > > --
> > > > > > Marcelo -http://maps.forum.nu
> > > > > > -- > > --
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to