Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9137929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:11:26+00:00 2026-06-17T09:11:26+00:00

I need to use the following coordinates in a separate php file and I

  • 0

I need to use the following coordinates in a separate php file and I guess the best way is to transfer via ajax.

The html is as follows:

 <div id="canvas">
 <div class="point1">
 <div class="coord"></div>
 </div>

 <div class="point2">
 <div class="coord"></div>
 </div>

 <div class="point3">
 <div class="coord"></div>
 </div> etc
 </div>

The jQuery UI draggable function I’ve currently written currently shows the top and left position of each div directly underneath the div being dragged:

...
element = this;
var top = $(this).position().top;
var left = $(this).position().left;
$('.coord', this).text('Top: ' + top + 'px' + ' Left: ' + left + 'px');
...

But in order to now use each of the point coordinates in PHP variables do I need to split out $('.coordinates', this) etc into an array first to transfer via ajax into php – and if so does anyone know how?

Or is there a simpler way – as I’m sure there probably is?!? I’m just a bit confused!

Appreciate any advice or pointers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:11:26+00:00Added an answer on June 17, 2026 at 9:11 am

    Well, I’m not so advanced but if you wanna pass data from javascript(jquery) to PHP and as you say with ajax use the jquery method $.post:

        $.post("file.php", { coordTop: top , coordLeft: left },
      function(data) {// ON REQUEST DONE YOU CAN RETURN (echo, print,..) DATA
        alert("Data: " + data);
      });
    

    And in the PHP file you catch those vars whith $_POST[“coordTop”] and $_POST[“coordLeft”]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was following this tutorial . I need to use a php file's ouput
I need to use the SharePoint API in the following way in a PowerShell
I have the following links in a sql dump file(.sql). I need to use
I have the following problem: I need to use XSLFO to generate a 2-column
I have the following method that returns void and I need to use it
I need to dynamically generate radio or checkbox by jQuery. I use the following
I need following namespaces to use native wpf property grid however, VS 2010 doesn't
Following situation: I need a container for data with a rowindex. Currently we use
I need to convert the following to decimal coordinates for consumption by a Google
I use the following code to render a line, given the coordinates in data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.