使用Ajax在PHP中的鼠标位置 [英] Mouse position with Ajax in PHP
本文介绍了使用Ajax在PHP中的鼠标位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用PHP中的鼠标位置发布Ajax请求?
例如。我在cUrl中获取一个页面,在这个页面上我想发布一个mousemovement事件。
我没有代码,我正在看函数 ncurses_getmouse
您可以使用此代码获取鼠标位置和发布请求:
您可以使用此代码获取鼠标位置和发布请求: $(#target)。mousemove(function(event){
$ .post( php,{x:event.pageX,y:event.pageY});
});
如果你需要帮助在PHP中做某事,你可以问我。
Is it possible to post an Ajax request with a mouse position in PHP?
For e.g. i'm fetching a page in cUrl, and on this page I would like to post a mousemovement event.
I have no code yet and am looking at the function ncurses_getmouse
but there is minimal information about it.
解决方案
You can use this code for getting mouse position and posting request:
$("#target").mousemove(function(event) {
$.post("test.php", {x: event.pageX, y: event.pageY});
});
If you need help with doing something with position in PHP, you can ask me.
这篇关于使用Ajax在PHP中的鼠标位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文