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

时间:2022-12-02 17:55:41

I am new to JQuery so i have to ask this question. I have to get the value of undermentioned code into a php file.

我是JQuery的新手,所以我不得不问这个问题。我必须将下面提到的代码的值放到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. how can i do that. please help

我想把这段代码写的文字带到下一个php页面。我怎样才能做到这一点。请帮忙

1 个解决方案

#1


0  

Sending data from client to server using jQuery (Javascript) usually used to send without refreshing the whole page. This called AJAX

使用jQuery(Javascript)将数据从客户端发送到服务器通常用于发送而不刷新整个页面。这称为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获取请求

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

如果您需要更多解释,请写信给我

#1


0  

Sending data from client to server using jQuery (Javascript) usually used to send without refreshing the whole page. This called AJAX

使用jQuery(Javascript)将数据从客户端发送到服务器通常用于发送而不刷新整个页面。这称为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获取请求

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

如果您需要更多解释,请写信给我