Jump to content

read php from javascript


mark103

Recommended Posts

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?
Link to comment
https://forums.phpfreaks.com/topic/276134-read-php-from-javascript/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.