如何使用PHP调用JavaScript [英] How to call a javascript with PHP
本文介绍了如何使用PHP调用JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个ajax函数来调用页面news.php.在此页面中,我有一个javascript,但该如何命名?因为我想用图片做幻灯片显示,以便从数据库中获取她的值.为了从数据库中获取值,我需要php,但是对于幻灯片,我需要Javascript.
那我怎么称呼functin slideshow()?
我通过Google获得的唯一解决方案是:
I have an ajax function which calls the page news.php. In this page I have a javascript but how can I call it? Because I want to make a slideshow with pictures which gets her values from a database. For get the values out of the database I need php but for the slideshow I need Javascript.
So how can I call the functin slideshow ()?
The only solution I got by google is:
echo "<script type=\"text/javascript\" language=\"Javascript\">slideshow ();</script>";
但它不起作用
有没有像jQuery这样的解决方案吗?
but it don´t works
Is there any solution without something like jQuery?
推荐答案
看看那些链接:
http://stackoverflow.com/questions/1045845/how-to- call-a-javascript-function-from-php [ ^ ]
http://www.killersites.com/mvnforum/mvnforum/viewthread_thread,6615 [ ^ ]
http://forums.devshed.com/javascript-development- 115/calling-javascript-function-from-php-4718.html [
Take a look at those links:
http://stackoverflow.com/questions/1045845/how-to-call-a-javascript-function-from-php[^]
http://www.killersites.com/mvnforum/mvnforum/viewthread_thread,6615[^]
http://forums.devshed.com/javascript-development-115/calling-javascript-function-from-php-4718.html[^]
I''ve used a small google search that returned thousands of results... Google is your friend...
Good luck!
这篇关于如何使用PHP调用JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文