Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Javascript
Passing variable from function to html body...
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="S. Cole, post: 4979439"] Hi, Can someone help me pass a variable from a function in a header to the body of an html page. Header Code: function doLoad() { xml = new XMLHttpRequest(); xml.onreadystatechange = function() { var elem = null; var rss_url = null; var edgerssfeed = null; var settings = null; var rssData = null; if( xml.readyState == 4 ) { settings = xml.responseXML.documentElement.getElementsByTagName( 'edgerssfeed' ); for( var c = 0; c < settings.length; c++ ) { rss_url = settings[c].getElementsByTagName( 'url' ) [0].textContent; elem = document.createElement( 'div' ); elem.innerText = rss_url; document.getElementById("edge_rss_feed").appendChild( elem ); rssData = new Spry.Data.XMLDataSet(rss_url, "rss/channel/item"); } } } xml.open( 'GET', 'settings.xml', true ); xml.send( null ); } body code: <div spry:region="rssData"> <table width="100%"> <tr spry:repeat="rssData"> I've left a few things out, but this is the basics of it.. Basically I need to pass the rssData variable from the function to the SPRY:REPEAT (SPRY:REGION) code in the html body. If I put the: rssData = new Spry.Data.XMLDataSet(rss_url, "rss/channel/item"); by itself and not in a function (with rss_url = the actual url) it works. Many thanks, Shannon [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Javascript
Passing variable from function to html body...
Top