JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 28th, 2006, 10:31 AM
moore82 moore82 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 1 moore82 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 45 sec
Reputation Power: 0
Load an Iframe using JS

Hello,

It's a simple problem to be honest but as I don't know much about Javascript, I'm stuck! Hopefully someone here can help me! Here goes...

I have a media player in a pop-up window. The player uses flash and after each click on the play button, the flash document "pings" a function in a javascript file and assigns a few values to a variable called - myReturnArg

I want one of the values in the array to be passed to a page in an iframe each time a track is played. This will allow me to update the database from the media player pop up window without having to reload the media player each time.

At the moment, I have the document showing an alert box with all the info in the array. Basically, I need to take the MP3 file location which is in the array and pass it to the iframe which holds a php page. The php page then takes the value and uses it to search for and update the relevant row in a mysql DB.

The media player popup php page uses the following code:

Code:
js_wimpy_returnOnComplete = "myReturnFunction";

function myReturnFunction(myReturnArg){

	
	alert ("Wimpy returned: " + myReturnArg + " \n\nBUMHOLE!");

	if(typeof(myReturnArg) == "object"){

		var returnedArray = myReturnArg;
		var myAction = returnedArray.shift();

		if(myAction == "wimpy_getTrackInfo"){
			printReturnedData(myAction, returnedArray);
		
		} else if (myAction == "wimpy_returnPlaylistItem"){
			printReturnedData(myAction, returnedArray);
		
		} else if (myAction == "wimpy_trackDone"){
			printReturnedData(myAction, returnedArray);
		
		} else if (myAction == "wimpy_trackStarted"){
			printReturnedData(myAction, returnedArray);
			
			function Add_Track_Play(track_ID) {
			  var iframe = document.getElementById("php_script");
			  if (!iframe) {
				alert("Your browser doesn't support IFRAMEs. \n\nPlease use a supported browser to view this site such as FireFox.");
				return false;
			  }
			  iframe.src = "(URL address blocked: See forum rules)="+track_ID;
			  return false;
			}
			
			Add_Track_Play(returnedArray[1]);
		}


	}

}


The popup page has an iframe like so:
Code:
<iframe id="php_script" width="500" height="500"></iframe>


Can you tell I don't know much about JavaScript?? I did manage to get the iframe to load a HTML page each time a track was played, however, once I tried to concatenate the info I needed, the page didn';t work any more.

Any help whatsoever would be great as I'm up against the wall with this one.

thanks

David

Reply With Quote
  #2  
Old November 30th, 2006, 06:22 AM
colton22's Avatar
colton22 colton22 is offline
\ ^_^ / - Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Location: near chicago, Illinois
Posts: 471 colton22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 1 h 10 m 16 sec
Reputation Power: 3
Send a message via AIM to colton22 Send a message via MSN to colton22 Send a message via Yahoo to colton22
i read through the code, i understand for the most part what your doing, can you please post how and what, in more detial, or just comented code?

comment tag for javascript is // per line

thanks
colton22
__________________


Hang Out, Listen To Music, Have Fun, and Customize Your Experiance All In One Place! - Colton22's World - This is My World

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Load an Iframe using JS


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway