Using "document.createTextNode"

This is a discussion on "Using "document.createTextNode"" within the JavaScript Forum section. This forum, and the thread "Using "document.createTextNode" are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 31st, 2005, 19:27
New Member
Join Date: Aug 2005
Location: Warwickshire, England
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Using "document.createTextNode"

Hi All,

I am working on the script below. It works but what I want to to is:

When the page loads it shows a map with a text box containing text which is pulled from the PHP variable.

Code: Select all
document.createTextNode("<?php echo $_GET['des']?>"));
The output could be "this is a test message for the webmaster"

What I want is:

"this is a
test message
for the webmaster"

spliting the line of text over morethan one line.

Can anuone help, please.



Code: Select all
var map = new GMap(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
    map.centerAndZoom(new GPoint(<?php echo $_GET['lon']?>, <?php echo $_GET['lat']?>), 2);
	
	var icon = new GIcon();
	icon.image = "http://www.google.com/mapfiles/marker.png";
	icon.shadow = "http://www.google.com/mapfiles/shadow50.png";
	icon.iconSize = new GSize(20, 34);
	icon.shadowSize = new GSize(37, 34);

	var marker = new GMarker(new GPoint(<?php echo $_GET['lon']?>, <?php echo $_GET['lat']?>)); 

	map.openInfoWindow(map.getCenterLatLng(),
       document.createTextNode("<?php echo $_GET['des']?>"));
	
  	map.addOverlay(marker);
[/code]
Reply With Quote

  #2 (permalink)  
Old Aug 31st, 2005, 20:30
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Can you just insert
tags in the text to make it break?
Reply With Quote
  #3 (permalink)  
Old Aug 31st, 2005, 21:15
New Member
Join Date: Aug 2005
Location: Warwickshire, England
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Jeff,

Thanks for your reply.

If I put
into the text which is stored in an sql database it does put a carridge return when the data is display in a normal php file.

But when I run the file with the javascript in it, the display is

From the A406
North Circular Road
North


This is driving me mad. Thanks again for any input you can give.
Reply With Quote
  #4 (permalink)  
Old Aug 31st, 2005, 21:55
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Try using .openInfoWindowHtml instead

Code: Select all
 map.openInfoWindowHtml(map.getCenterLatLng(), "<?php echo $_GET['des']?>");
See http://www.google.com/apis/maps/docu...n/#Info_Window
Reply With Quote
Reply

Tags
using

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Show "Image" Depends On User "Status"? Monie Classic ASP 6 Oct 16th, 2007 01:22
document.getElementById("tabs") has no properties afmanuk JavaScript Forum 3 Sep 7th, 2007 19:11
? IS "meta name="robots" content="?" necessary in pages ? Love2Java Starting Out 6 Aug 8th, 2007 13:48
document.getElementById("userProfileCheck") is not working in Mozilla Firefox dhineraj JavaScript Forum 1 Jul 20th, 2007 05:32
window.opener.document["nameForm"].getElementById("someid").value; doesnt work drpompeii JavaScript Forum 0 Feb 17th, 2007 23:09


All times are GMT. The time now is 00:08.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43