hi there im trying to pass my jquery variable onto php
j query bit
<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');
what i want to do is call my txt variable into php for example
<?php $templatewidth = (myjquery variable txt) ;?>
You'd need to make an XHR to the server to send that variable to PHP.
Look at the j Query AJAX methods .
It is too late to send data back to the instance of the PHP program that generated the page.
You can send new data by making an HTTP request (eg via XMLHttpRequest), get a response in JS and then handle that new data in JS.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.