Results 1 to 4 of 4

Thread: How to enable Javascript in PHP

  1. #1
    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.

  2. #2
    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;

  3. #3
    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.

  4. #4
    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.); 
                 ); 
          )

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,713,650.32806 seconds with 17 queries