如何把脚本放在PHP? [英] how to put script in php?

查看:63
本文介绍了如何把脚本放在PHP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能把我的jquery脚本

用于php

它无法正常工作。

how can i put my jquery script
in php
its not work.

推荐答案

这个这不是一个正确的问题。你还没有明白这个想法。 Javascript在浏览器中的客户端大小上执行,PHP在服务器端执行。



如果PHP可以被认为与Javascript有某种关联,这只是因为PHP可以生成任何内容以响应HTTP请求。怎么样?抛出 echo ,对于某些内容类型, header ;阅读那些PHP指令。而且,如果PHP生成了HTML中使用的一些HTML和Javascript,它将被发送回客户端,脚本可以相应地执行。就是这样。



我建议你学习HTTP如何工作,客户端和服务器端会发生什么。



-SA
This is not a correct question. You did not get the idea yet. Javascript is executed on the client size in the browser, and PHP is executed on the server side.

If PHP can be considered as somehow related to Javascript, this is only because PHP can generate any content in response to HTTP request. How? Throw echo, and, for some content types, header; read about those PHP instructions. And, if PHP generates some HTML and Javascript used in that HTML, it will be sent back to the client where the scripts can executed accordingly. That's it.

I would advise you to learn how HTTP works, what happens on client and server side.

—SA


这篇关于如何把脚本放在PHP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆