Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Solved (My Fault)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •