Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing HTML with Javascript

Status
Not open for further replies.

GiffordS

Programmer
May 31, 2001
194
CA
Having an issue creating a custom window for a google map application. The actual problem is with putting text inside the window. Everything works until I try to put some html in there and then it all falls apart. Here's the basic code that actually works....

Code:
    var point = new GLatLng(27.895526,-82.736754);
      var html = 'Foo';

That pops up the infowindow with Foo inside of it. However, when I try to expand that and add a little formatting....

Code:
 var point = new GLatLng(27.817875,-82.654844);
      var html =' <table class="arial13black borderb" width="200">
   <tr><td width="200">Price</td></tr>
   <tr><td width="200">Address</td></tr>
   <tr><td width="200">image</td></tr>
   </tr>
   </table>';

the entire script breaks. I'm guessing this is an escaping issue but I'm a bit clueless with exactly what or where as I don't usually work in JS. Any thoughts?
 
Gifford, do you have a page online where we can view this? You're likely using some imported .js file because GLatLng is not a built in Javascript object. Without seeing what this object is or what it does, it's near impossible to give you any suggestions.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
kaht,

Thanks for trying. The issue wasn't actually pretty simple. I had linebreaks in the html which caused the script to end abruptly. Once I formatted the html all in one line it clicked right along.

As for the script itself, it's part of the google map api, but I've already asked on this forum before if anyone had some knowledge of that api and got no response, so it did not seem relevant to post the entire script. Thanks again for the response though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top