-1

Asp.net page with jquery 1.7.1 When I post it from an Android phone via an emulator in Eclipse the post without the http://www.somedomain.com/ works perfectly. If i include the http url it does not work. The insert into the database is fine with wfo_s.aspx but not with http://www.somedomain.com/wfo_s.aspx

If anyone can shed some light on why this is happening, I would really appreciate it. Thanks!

//this does not work? //$.post("http://www.somedomain.com/wfo_s.aspx", { the_User: theheatmap, conn: db_connection }, function (data) { }); //$.post("http://www.somedomain.com/wfo_s.aspx?the_User=" + theheatmap + "&conn=" + db_connection); //this does work, why does the post to the url not work, page works fine //$.post("wfo_s.aspx", { the_User: theheatmap, conn: db_connection }, function (data) { }); //$.post("wfo_s.aspx?the_User=" + theheatmap + "&conn=" + db_connection); 
10
  • 2
    Most probably http://www.somedomain.com is not the same server (domain, sub domain and protocol) as the one that served the current page. Commented Jul 17, 2012 at 19:47
  • Maybe it won't work because it is all commented out? Commented Jul 17, 2012 at 19:52
  • Tested locally or on the remote server, the http url from android emulator does not post to database. But when i just use wfo_s.aspx... it works perfectly? If I run the same code on my regular laptop both methods work. Commented Jul 17, 2012 at 19:55
  • possible duplicate of Cross-Domain Requests with jQuery ok well nevermind this is not the case I suppose. Commented Jul 17, 2012 at 19:55
  • 1
    are you sure you are not trying to connect (locally) to localhost.com??? Commented Jul 17, 2012 at 19:56

2 Answers 2

1

You cannot do ajax requests cross site.

There are some hacks (eg: jsonp) but not with regular requests.

Sign up to request clarification or add additional context in comments.

Comments

0

Doh! I was testing Android 1.5 and then loaded Android 2.1 and the post now works.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.