Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

read php from javascript

$
0
0

Hi guys

I need your help. I am writing the list of code in my javascript and now I want to read my php code from my javascript using with loadjscssfile("test1.php", "js") function.

function loadjsfile(filename)

{

    var fileref=document.createElement('script');

    fileref.setAttribute("type","text/javascript")

    fileref.setAttribute("src", filename);

    document.body.appendChild(fileref);

}



document.onkeydown = function(ev)

{   

   var key;

   ev = ev || event;

   key = ev.keyCode;

   var image1 = document.getElementById("image1").getElementsByTagName("img")[0];



   if(key == 13)

   {

      if (img1.indexOf('image1_yellow.jpg') != -1)

      {

         if (img5.indexOf('picture1_yellow.jpg') != -1)

         {

            loadjscssfile("test1.php", "js");

         }

      }

   }


Does anyone know how i can read my php code from javascript?

Viewing all articles
Browse latest Browse all 13200

Trending Articles