jQuery post not returning data

喜夏-厌秋 提交于 2019-12-11 14:08:16

问题


I'm having problems with one of my main host that doesn't want to return any game queries, so I made a script and uploaded it to another host that can fetch the game server data. Added an jquery script to my main host, but it doesn't seem to be fetching the post data. I have an echo on that page, so I should see result data, but it doesn't show.

jQuery code

<script type='text/javascript'>
    $(document).ready(function(){
        $("input.senddata").click(function() {
            var ipForm = $('input[name="ip_submit"]').val();
            var gameForm = $( 'select[name="game_submit"]' ).val()
            $.post('http://gamepwn.net/serversdotee/add-server.php', { ip: ipForm, game: gameForm }, function(data) {
              $('.result').html(data);
            });
        });
    });
</script>

Does anybody know a different solution that I could use to achieve this, or any fixes to my code?

来源:https://stackoverflow.com/questions/11207620/jquery-post-not-returning-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!