Results 1 to 2 of 2
  1. #1
    ricktee76 is offline Member
    Join Date
    Mar 2008
    Posts
    1
    Rep Power
    0

    Default echoing php array

    I need to echo a php array where the red highlight is, i've tried various combination with no luck
    Java Code:
      function showItemOfTheDay()
        {
            var xmlDocument = request.responseXML;
            var nodes = xmlDocument.selectNodes( '//item' );
            var numberOfItems = nodes.length;
       [COLOR="Red"]     var where = '<?PHP echo "$msstrip"; ?>';[/COLOR]
            var randomNumber = getRandomNumber( numberOfItems );
            var selectedNode = nodes[randomNumber];
            var thumbnail = selectedNode.selectSingleNode( 'media:thumbnail//@url' );
            var title = selectedNode.selectSingleNode( 'title' );
    //        var link = selectedNode.selectSingleNode( 'link' );
            divLink.innerHTML = '<img src="' + thumbnail.text + '" width="90" height="70" alt="' + title.text + '" border="0"/></a>';
    //    divLink.innerHTML = '<a href="' + link.text + '" target="_blank"><img src="' + thumbnail.text + '" width="90" height="60" alt="' + title.text + '" border="0"/></a>';
        }
        
        // Eventhandler, will be fired for every state change on our XMLHttpRequest.
        function request_onReadyStateChange()
        {
            var status = request.readyState;
            divStatus.innerText = getStatusDescription( status );
            if ( status == 4 )
            {
                showItemOfTheDay();
            }
        }
    
    function UpdateGadget()
        {
            var url = 'http://www.awebsite.com/things/are/here/page=[B][COLOR="Red"]+ where +[/COLOR][/B]';
            request = new XMLHttpRequest();
            request.onreadystatechange = request_onReadyStateChange;
            request.open("GET", url);
            request.send();
            
            window.setTimeout(UpdateGadget, (1000 * 60 * 60 ));
        }
        
        
        // Eventhandler, will fire when the body of our gadget has completed loading.
        function Page_onLoad()
        {
            divStatus.style.display = "none";
            UpdateGadget();
        }
    
        </script>
    </head>
    <body onload="Page_onLoad();">
     <g:background>
      <img id="imgNFLlogo" src="NFL-corner.png" />
      <div id="divLink"></div>
      <div id="divStatus"></div>
      </g:background>
    all works except the echo of the PHP.

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    It would appear you've stumbled upon the wrong forums, my friend. Welcome to the Java Forums. :) But I'm sure if someone knows they will probably assist anyways.
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

Similar Threads

  1. Array Help
    By bluegreen7hi in forum New To Java
    Replies: 2
    Last Post: 03-28-2008, 03:25 AM
  2. can anyone help... 2d Array
    By Mark1989 in forum New To Java
    Replies: 2
    Last Post: 03-12-2008, 09:59 PM
  3. Would appreciate your help with 2d Array..
    By cloudkicker in forum New To Java
    Replies: 1
    Last Post: 02-11-2008, 03:34 PM
  4. 2D array
    By bluekswing in forum New To Java
    Replies: 2
    Last Post: 01-15-2008, 06:57 PM
  5. Help with Array
    By susan in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •