...

View Full Version : Access Variable in Function



dizzy
02-28-2009, 01:56 AM
Hi im trying to access a variable from a function i can acces it in the fuction but not outside:


<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
02-28-2009, 04:06 AM
Solved (My Fault)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum