#1 (permalink)  
Old 06-10-2009, 12:24 PM
Registered User
 
Join Date: Jun 2009
Posts: 2
Question Randomize youtube embed?

I have no experience with Java or Css, but I do know some HTML and was wondering if anybody knew a code that could randomize youtube embeds.

What I mean is, every time you load a page, a script will prompt a different youtube HTML embed code. So basically, the youtube code isn't changed at all. Just randomized.

Can anybody help me?

I appreciate any and all responses

  #2 (permalink)  
Old 06-30-2009, 07:53 AM
Registered User
 
Join Date: Jan 2009
Location: Localhost
Posts: 50
You can create an array of urls which you need to embed. And then you can use the random function

Try some thing like this

Code:
import java.util.Random;

public class stringList {
   
    String[] sList = { "embed1", "embed2", "embed3", "embed4"};
   
    Random s = new Random();
    int Select = 0;
   
    String list = sList[produceNumber()];
       
    public int produceNumber()
    {
   
        Select = (s.nextInt(sList.length));
       
        return Select;
    }
}
__________________
Dedicated Servers - sales@hivelocity.net - 1-888-869-HOST(4678)
Award winning Managed Hosting - Dedicated Server Hosting
Managed Dedicated Servers. Reseller Discounts. 24/7 Impressive Tech Support.
  #3 (permalink)  
Old 07-17-2009, 01:30 PM
Registered User
 
Join Date: Jun 2009
Posts: 2
I've tried this, and the text showed up. i don't think the site I'm trying to use this for allows Java scripts. Is there any way to do this with simple html?
  #4 (permalink)  
Old 11-19-2009, 02:27 AM
Registered User
 
Join Date: Nov 2009
Posts: 5
Quote:
Originally Posted by Progressive View Post
I have no experience with Java or Css, but I do know some HTML and was wondering if anybody knew a code that could randomize youtube embeds.

What I mean is, every time you load a page, a script will prompt a different youtube HTML embed code. So basically, the youtube code isn't changed at all. Just randomized.

Can anybody help me?

I appreciate any and all responses

Can you give some more samples? How great your info is! It really useful for me. Thanks.
Closed Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing: How to make a video sharing website like YouTube flyinpc Programming and Scripting 5 01-12-2009 05:57 AM
i got a big problem with embed player DiSHi Programming and Scripting 1 12-24-2008 10:55 PM
javascript in embed src="" gilgalbiblewhee Programming and Scripting 2 07-05-2006 09:19 PM
How to randomize a advertsiement in php code? CAG Hotshot Programming and Scripting 1 01-28-2005 03:59 AM


All times are GMT -5. The time now is 08:36 AM.

 
Clicky Web Analytics
CloudContacts
Loop11
Page.ly


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
© 1997-2009 HTMLCenter