|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
calling javascript in php
Hi,
Iam trying to call javascript from php on mosemove event. When i use the script in html file it works fine but when i use it with php it gives object expected error. Iam new to all these stuff Any help is appreciated. Thanks in Advance nemoz |
|
#2
|
||||
|
||||
|
Try posting some code.
|
|
#3
|
||||
|
||||
|
PHP and Javascript aren't related. Javascript is a Client-side technology, and PHP is server-side. They cannot interact at the same time.
|
|
#4
|
||||
|
||||
|
I figured he was asking about generating javascript dynamically using PHP code.
|
|
#5
|
||||
|
||||
|
...
Would def. be a help if you posted code - but first thing is check, check, recheck your quotes - if you're using echo to output your javascript then chances are you've forgotten to backslash a quote or two.
Also: try loading the page in Netscape then loading the (very helpful) Tools->Web Development -> JavaScript Console, which will tell you where the script is failing (assuming it's sproinging an error) Remember what Stumpy posted - PHP is server-side, which means that by the time your browser is doing Javascripty-things, the PHP has finished running (that might not technically be correct, but think of it that way). The process is: browser requests PHP page from server, PHP script runs on server and sends lines back to the browser (plain HTML or HTML & Javascript or whatever) - there is no way for the javascript on the page to interact with the PHP that created it. Al |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > calling javascript in php |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|