Is there any way to call a JAVASCRIPT function in PHP in AJAX

Answers were Sorted based on User's Feedback



Is there any way to call a JAVASCRIPT function in PHP in AJAX..

Answer / arya

<?php
$str = '<script language="javascript">
function get_pop_up()
{
alert("This is a way to call JAVASCRIPT function in PHP");
}
</script>
<input type="button" name="Click" value="Click"
onclick="get_pop_up();">
';

echo $str;
?>

Is This Answer Correct ?    15 Yes 3 No

Is there any way to call a JAVASCRIPT function in PHP in AJAX..

Answer / ashiq

yes , who say no
definite their is way to call javascript function when
calling ajax, ajax execute php script and with in the ajax
commmand we can call after ajax function which execute the
javascript function code

examaple



if (request.readyState == 4)
{
if (request.status == 200)
{
data=request.responseText;
document.getElementById
(_dynCont).innerHTML=data;
try
{
jSFromAjax
(varbol=true,varStr='');
}
catch(ex){}
}
}


this is the function that execute the js with ajax

Is This Answer Correct ?    14 Yes 4 No

Is there any way to call a JAVASCRIPT function in PHP in AJAX..

Answer / ravi

No

Is This Answer Correct ?    16 Yes 9 No

Is there any way to call a JAVASCRIPT function in PHP in AJAX..

Answer / guest_shah

in php u can call javascript function in onlclick or onchange
event of html tag.or u can call like
?><script language='javascript'>
javascriptfunction
</script>
<?

Is This Answer Correct ?    3 Yes 13 No

Post New Answer

More PHP Interview Questions

Does php have a future?

0 Answers  


What is php in simple words?

0 Answers  


How do you check if a variable has not been set in php?

0 Answers  


What are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ?

7 Answers   HCL,


Explain the difference between require() and require_once()?

0 Answers  






What is strcmp () in php?

0 Answers  


How would you open a directory for reading in php?

0 Answers  


What are the rules in creating php variable?

0 Answers  


Can you define an argument as a reference type?

0 Answers  


Is null or empty c#?

0 Answers  


What is a php tag?

0 Answers  


How can I find the width and height of an image resource?

2 Answers   Rushmore Consultancy,


Categories