Call and implement PHP+javascript code by using ajax

Discussion in 'JavaScript' started by lionking, Jun 5, 2011.

  1. #1
    Hi

    I have Mixed Code php + javascript Inside php file . I called the code inside this file by ajax .

    Example of the php code

    
    echo "<script type='text/javascript'>
      alert('Hello')
    </script>";
    
    PHP:
    The problem is that PHP code is executed, but the JavaScript code is not executed .

    Is there a solution for the implementation the two codes PHP + JS using ajax request
     
    lionking, Jun 5, 2011 IP
  2. Jan Novak

    Jan Novak Peon

    Messages:
    121
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    0
  3. darbetim

    darbetim Member

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    it should've run
     
    darbetim, Jun 11, 2011 IP