The js...
Code:
<script language="javascript">
$("#div_weather").putWeather({
location:"Barlborough, Derbyshire, UK"
});
</script>
works spot on.
As soon as I add the php (that I'm told should work if user is defined) thus...
Code:
<?php $user = elgg_get_page_owner_entity();?>
<script language="javascript">
$("#div_weather").putWeather({
location:"<?php echo $user->location;?>"
});
</script>
I get...
Loading weather... displayed on screen and if I check View Source it gives me this code...
Code:
<html>
<head>
<title>Weather Widget Example 1</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/jquery.weather.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/weather_output.css" type="text/css" />
</head>
<style type="text/css">
body{
margin:4px;
}
.description{
font-size:10px;
}
</style>
<body>
<div id="div_weather">
Loading weather...
</div>
No js present or the closing </body> & </html> tags.
Bookmarks