Need some java expert

Discussion in 'JavaScript' started by dicecities, Jun 14, 2013.

  1. #1
    I am have a php page which calls up a video by id from mysql then puts it into viewing code <embed> etc etc etc </embed>

    page name is like embed.php?id=xxxxx

    xxxx being different id numbers.

    what i need is a java js file like embed.js?id=xxxxx to get the contents of my php page with same id and display it.

    This way people can use
    <script type="text/javascript" src="domain.com/embed.js?id=xxxxx"></script>
    to embed it on their website.

    just need the js file.

    Anyone who can do this for me please pm me your price
    thanks
     
    dicecities, Jun 14, 2013 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    1) JavaScript is to Java as Hamburger is to Ham -- it's unclear which you want, but be aware they are two UNRELATED languages that just happen to share 4 letters.

    2) Not entirely clear on what you are asking for -- are you asking for the code to parse the getData from the URI? If so, that goes something like this:

    function getData(url) {
    	var
    		data = url.substring(
    			url.indexOf('?') + 1,
    			url.indexOf('#") || url.length
    		).replace(/\+/g,' ').split('&'),
    		result = {},
    		t = data.length;
    	while (t>0) {
    		var dataPair = data[--t].split('=');
    		result[decodeURIComponent(dataPair[0])] = decodeURIComponent(dataPair[1]);
    	}
    	return result;
    }
    Code (markup):
    Which would take the getData from the URI and split it into an object.
     
    deathshadow, Jun 15, 2013 IP