Scenario
A content type called "Playlist" exists. Playlist has a text field: field_playlist_sources. When a user creates the Playlist they can add multiple values for field_playlist_sources. Each value is a url like: http://somesite.com.
When the Playlist node is viewed, the field_playlist_sources field is displayed with a Custom Formatter (using the Custom Formatters module). The format for the display of this field is:
<iframe src="" name="frame" id="frame" width="100%" height="1080px" seamless frameborder="0" scrolling="no"></iframe>
Notice the empty src.
What I'd like to do is loop through the values provided for field_playlist_sources within the iframe.
With Javascript this would look like this:
var frameSRC = Array(
'http://someurl.com', 60,
'http://anotherurl.com', 60);
var i = 0, len = frameSRC.length;
function ChangeSrc() {
if (i >= len) { i = 0; } // start over
document.getElementById('frame').src = frameSRC[i++];
setTimeout('ChangeSrc()', (frameSRC[i++]*1000));
}
window.onload = ChangeSrc;
As of right now, I'm not sure how to bring in the values from the field to this javascript file. Maybe there is a better approach?
Any help would be greatly appreciated.