简体   繁体   English

如何在php文件中获取javascript变量的值

[英]How to Get the value of javascript variable in php file

I am new to JQuery so i have to ask this question. 我是JQuery的新手,所以我不得不问这个问题。 I have to get the value of undermentioned code into a php file. 我必须将下面提到的代码的值放入一个php文件中。

  jQuery(function($){ var textover_api; // How easy is this?? $('#target').TextOver({}, function() { textover_api = this; }); 

I want to get the text written by this code to the next php page. 我想将此代码编写的文本发送到下一个php页面。 how can i do that. 我怎样才能做到这一点。 please help 请帮忙

Sending data from client to server using jQuery (Javascript) usually used to send without refreshing the whole page. 使用jQuery(Javascript)从客户端向服务器发送数据,通常用于发送而不刷新整个页面。 This called AJAX 这叫做AJAX

There are several sending methods to do it, the most popular are: POST & GET 有几种发送方法,最受欢迎的是:POST&GET

A few examples: 一些例子:

GET request with jQuery jQuery的GET请求

POST request with jQuery jQuery的POST请求

Sending form data using AJAX 使用AJAX发送表单数据

POST vs GET in AJAX AJAX中的POST与GET

Write me if you need more explanation 如果需要更多说明,请写信给我

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM