Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-28-2009, 12:56 AM   PM User | #1
dizzy
New to the CF scene

 
Join Date: Feb 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
dizzy is an unknown quantity at this point
Access Variable in Function

Hi im trying to access a variable from a function i can acces it in the fuction but not outside:

Code:
<input type="submit" value="Do whatever" onclick="javascript:
		
		 usePointFromPostcode('<?=$aPostCode;?>',
		  
		 function (point) {
			 			 
			MeLat=point.lat();
			MeLon=point.lng();
			
			 alert('Latitude: ' + MeLat+ '\nLongitude: ' + MeLon); 
			   
		 	   return MeLat;      
		      }  		      
		    )
		      
		      " />
		      
		<script type="text/javascript">			   
		document.write(MeLat);
		</script>
i can get the alert to work but not the document.write(MeLat);


THANKS IN ADVANCE
DIZZY
dizzy is offline   Reply With Quote
Old 02-28-2009, 03:06 AM   PM User | #2
dizzy
New to the CF scene

 
Join Date: Feb 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
dizzy is an unknown quantity at this point
Solved (My Fault)
dizzy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 02:28 PM.


Advertisement
Log in to turn off these ads.