Results 1 to 2 of 2

Thread: if string changes then run some code?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2009
    Posts
    876

    if string changes then run some code?

    Hi guys, I have a string that is echo'd on my PHP page

    $output_string

    and a piece of javascript updates $output_string with the current song being played on the radio, now is it possible to automatically run a piece of code everytime that $output_string changes?


    Regards
    Jamie.

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: if string changes then run some code?

    You are mixing the JavaScript with PHP ! Once the page is echoed or displayed on the user's browser, what you get is the output of the PHP code! If you wish to communicate with the PHP page and dynamically change the contents, you could use AJAX. jQuery library has 3 or 4 AJAX extensions. Have a look at it.


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

Posting Permissions

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



Click Here to Expand Forum to Full Width