如何将一个jquery变量传递给php [英] how to pass a jquery variable to php

查看:392
本文介绍了如何将一个jquery变量传递给php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的jquery变量传递到php

hi there im trying to pass my jquery variable onto php

j查询位

 <script> $(document).ready(function() {

$(function() {
    $( "#tabs" ).tabs().find( ".ui-tabs-nav" );
});

$("#resizable").resizable({ maxWidth: 500,  minWidth: 250 ,handles:'e', grid: [1, 1] } );
 var txt =$("#resizable").width() * 2;  $("#test").text('Template Width: ' + txt + 'px');
 $("#resizable").resize(function() {
     txt = $("#resizable").width() * 2;
      $("#test").text('Template Width:' + txt + 'px'); 

我想做的就是例如将txt变量称为php

what i want to do is call my txt variable into php for example

<?php $templatewidth = (myjquery variable txt) ;?>

推荐答案

您需要对服务器进行XHR,以将该变量发送到PHP.

You'd need to make an XHR to the server to send that variable to PHP.

查看j 查询AJAX方法.

这篇关于如何将一个jquery变量传递给php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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