/    Sign up×
Community /Pin to ProfileBookmark

eval a assigned variable

I have a var Wdoc who has this below values how can i push them to the page
weatherStations=new Array();
var t=new Array();
t[‘ageh’]=0;
t[‘agem’]=23;
t[‘ages’]=54;
t[‘type’]=”ICAO”;
t[‘id’]=”SVMI”;
t[‘lat’]=”10.60000038″;
t[‘lon’]=”-66.98000336″;
t[‘adm1’]=”Caracas Simon Bolivar”;
t[‘adm2’]=””;
t[‘country’]=”VN”;
t[‘dateutc’]=”2008-05-27 09:00:00″;
t[‘winddir’]=”0″;
t[‘windspeedmph’]=”0.0″;
t[‘humidity’]=”100″;
t[‘tempf’]=”78.8″;
t[‘rainin’]=”-9999.00″;
t[‘baromin’]=”29.83″;
t[‘dewptf’]=”78.8″;
t[‘weather’]=”Light Drizzle”;
t[‘clouds’]=”BKN”;
t[‘flightrule’]=”VFR”;
t[‘visibilitysm’]=”5.6″;
t[‘windgustmph’]=”-9999.0″;
t[‘snowin’]=”-9999.00″;
t[‘name’]=”Caracas Simon Bolivar”;
t[‘elev’]=”157″;
t[‘windchillf’]=”-999″;
t[‘heatindexf’]=”-9999″;
t[‘maxtemp’]=”80.6″;
t[‘mintemp’]=”78.8″;
t[‘maxdewpoint’]=”78.8″;
t[‘mindewpoint’]=”77.0″;
t[‘maxpressure’]=”29.89″;
t[‘minpressure’]=”29.83″;
t[‘maxwindspeed’]=”2.3″;
t[‘maxwindgust’]=”-9999″;
t[‘maxrain’]=”-9999″;
t[‘dailyrainin’]=”0.00″;
t[‘dailyrain_2day’]=”0.00″;
t[‘maxheatindex’]=”88.2″;
t[‘minwindchill’]=”-9999″;
weatherStations[0]=t;
weatherStations=weatherStations;
mapApp.MapCallbackW(weatherStations);

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991May 27.2008 — Write them onto the page is it? If it's before page load:

[b]JavaScript:[/b][code=php]
document.write(t);
[/code]

or[code=php]
for (i in t) {
document.write(t[i]+"<br />");
}[/code]
Copy linkTweet thisAlerts:
@rsolerauthorMay 27.2008 — var WDoc= responseDetails.responseText;

being responseDetails the answer of a request
Copy linkTweet thisAlerts:
@Declan1991May 27.2008 — But what do you actually want to do? push what onto the page, you have shown no code with Wdoc. Is it an array, a string what?
Copy linkTweet thisAlerts:
@rsolerauthorMay 27.2008 — I try to explain what i do, i read a location from a map and go to an adrres with gm_hhtprequest trought muy proxy then i assing yhe var var MyDoc=request.responseText;

which is the text that i want o push into my page i try also to write with php to a file and then read it as a web page inside an iframe but i can not write it problems with php , i would like to pass the values to the executing page so i can then create the markers.here is part of the code and all my tries


WeatherMap.prototype.MapCallback = function(weatherStations)

{

var map = mapApp;

this.weatherStations_ = weatherStations;

var bounds = mapApp.map.getBounds();

var southwest = bounds.getSouthWest();

var northeast = bounds.getNorthEast();

bounds.maxY = northeast.lat();

bounds.minY = southwest.lat();

bounds.maxX = northeast.lng();

bounds.minX = southwest.lng();

var now = new Date();

var year = now.getYear() + 1900;

var month = now.getMonth();

var day = now.getDate();

// var url = "http://mysite.com/zoom/tiempo/ProxyGet2.php?url=http://stationdata.wunderground.com/cgi-bin/stationdata?maxlat=10.569497147659133&minlat=10.127737127781&maxlon=-67.8460693359375&minlon=-68.49494934082031&file=RSSW.htm"

var url = 'http://stationdata.wunderground.com/cgi-bin/stationdata?maxlat=' + bounds.maxY + '&minlat=' + bounds.minY + '&maxlon=' +

bounds.maxX + '&minlon=' + bounds.minX + '&iframe=1';

// bounds.maxX + "&minlon=" + bounds.minX + "&iframe=1";

var url1 = url;

// url = 'http://mysite.com/zoom/tiempo/ProxyGet2.php?url=' + url + '&file=RSSW.htm'; //this was a try to put the file in my placa es htm

// _gi('stationscript').src = url;

// var url = 'http://stationdata.wunderground.com/cgi-bin/stationdata?maxlat=10.690972174450253&minlat=10.249384299585941&maxlon=-67.8460693359375&minlon=-68.49494934082031';

// url = 'http://mysite.com/zoom/tiempo/ProxyGet2.php?url=' + url + '&file=RSSW.htm';

GM_xmlhttpRequest(

{

method : 'GET',

url : url1,

headers :

{

'User-agent' : 'Mozilla/4.0 (compatible) Coop El Recreo',

'Accept' : 'application/atom+xml,application/xml,text/xml,text/plain'

}

,

onload : function(responseDetails)

{

// hideLoadingMessage();

// var parser = new DOMParser();

// var dom = parser.parseFromString(responseDetails.responseText, "application/xml");

// window.clipboardData.setData("Text", responseDetails.responseText);

alert(responseDetails.responseText);

// url = 'http://myplaca.com/zoom/tiempo/Write.php?url=' + responseDetails.responseText + '&file=RSSW.htm';

// _gi('stationscript').src = url;

// _
gi('stationscript').src = 'http://myplace.com/zoom/tiempo/RSSW.htm';

// var WDoc = '<html><head><title>Datos</title></head><body><script language="javascript">' + responseDetails.responseText;

// var WDoc = responseDetails.responseText;

var WDoc = responseDetails.responseText;

WDoc = WDoc.replace('wunderground.com', 'mysite.com');

// WDoc = WDoc.replace('"MIRANDA"', 'MIRANDA"');

WDoc = WDoc.replace('parent.MapCallback(weatherStations);', 'parent.weatherStations=weatherStations;parent.mapApp.MapCallbackW(weatherStations);');
// WDoc = WDoc.replace('MapCallback(weatherStations);', 'parent.weatherStations=weatherStations;parent.mapApp.MapCallbackW(weatherStations);</script></body></html>');
// document.referrer.write(WDoc);
// eval(WDoc);
// window.clipboardData.setData("Text", WDoc);

// _gi('stationscript').src = 'http://mysite.com/zoom/tiempo/datos.htm';
// _gi('frame_oculto2').src = 'http://mysite.com/zoom/tiempo/datos.htm';
// saveSnapshot(WDoc);//also tried with scripting object



}

}

);

}

;
×

Success!

Help @rsoler spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...