0

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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Kristjan
  • 113
  • 2
  • 7
  • 2
    your code is not working due to Same-origin-policy(i.e. that is you cannot make request across domains without allowing access from other server or using jsonp ). – Furqan Hameedi Jun 26 '12 at 12:48
  • See this answer [here](http://stackoverflow.com/a/2686406/586621) – Jay Jun 26 '12 at 12:52

0 Answers0