Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 12-05-2009
Member
 
Join Date: Apr 2009
Posts: 61
How to enable Javascript in PHP

I use the ActiveXObject object for FireFox as my HttpRequest to call a page test.php

But I noticed that whenever i run javascript my page gets executed as test.php. Which is suppose is a BIG problem.I have read many things but nothing is similar to it, I can not execute the javascript code in test.php. Can someone how to use it?

I try to display an alert in test.php,but nothing goes in the positive way.
Reply With Quote
  #2  
Old 12-05-2009
Member
 
Join Date: Dec 2008
Posts: 183
Re: How to enable Javascript in PHP

I think you cannot implement PHP and JavaScript on the same machine, you need to implement javascript on the client machine and php on the server, they are never executed at the same time (very bad words but I will attempt a example)

Try something like this:

Code:
  $ str = "alert ( 'yep');" 
  echo $ str;
Reply With Quote
  #3  
Old 12-05-2009
Member
 
Join Date: Dec 2008
Posts: 161
Re: How to enable Javascript in PHP

To enable JavaScript support in new PHP Projects follow the following steps:
  1. Go to File Menu and select New | PHP Project.or you may also try using the PHP Explorer view, right-click and select New PHP Project.
    The new PHP Project wizard will launch.
  2. The New page will get open and you can enter the required information in the various fields.
  3. To enable JavaScript support for your current project, mark the 'Enable JavaScript support for this project' in the checkbox this will allow to open the new projects in the javascript.Click Finish.
Reply With Quote
  #4  
Old 12-05-2009
Member
 
Join Date: Jan 2009
Posts: 140
Re: How to enable Javascript in PHP

Here i will provide you the javascript code for your project.

Code:
  function sendData (cpt) 
     ( 
         if (document. all) ( 
             xhrObj var = new ActiveXObject ( "Microsoft.XMLHTTP"); / / Internet Explorer 
         ) 
         else ( 
             xhrObj var = new XMLHttpRequest () / / Mozilla 
         ) 

         XhrObj. Open ( 'GET', 'test.php', true); 
         xhrObj. send (''); 

         XhrObj. Onreadystatechange = function () (  
           if (readyState xhrObj.! = 4) return; 
               eval (responseText xhrObj.); 
             ); 
      )
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to enable Javascript in PHP"
Thread Thread Starter Forum Replies Last Post
How to Enable Sun JavaScript in Mozilla FireFox? hariharan_00 Software Development 5 04-02-2010 12:14 AM
How to enable javascript in IE8 roshan45 Technology & Internet 4 26-10-2009 08:23 PM
Enable Android Javascript Mind It Software Development 2 21-09-2009 03:07 PM
i need to enable javascript ben4147 Windows Update 10 06-05-2008 09:15 PM
Where is in IE 7 enable/disable javascript? Jack Vista Help 3 06-04-2007 06:14 AM


All times are GMT +5.5. The time now is 07:40 AM.