|
| |||||||||
| Tags: activexobject, httprequest, javascript code, php |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| 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
| |||
| |||
| 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
| |||
| |||
| Re: How to enable Javascript in PHP
To enable JavaScript support in new PHP Projects follow the following steps:
|
|
#4
| ||||
| ||||
| 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.);
);
) |
![]() |
|
| Thread Tools | Search this Thread |
| |
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 09:23 PM |
| Enable Android Javascript | Mind It | Software Development | 2 | 21-09-2009 04:07 PM |
| i need to enable javascript | ben4147 | Windows Update | 10 | 06-05-2008 10:15 PM |
| Where is in IE 7 enable/disable javascript? | Jack | Vista Help | 3 | 06-04-2007 07:14 AM |