jquery post and get request different on local intranet and live server

Posted by nccsbim071 on Stack Overflow See other posts from Stack Overflow or by nccsbim071
Published on 2010-04-23T06:06:04Z Indexed on 2010/04/23 6:13 UTC
Read the original article Hit count: 269

Filed under:
|
|
|
|

Hi,

I have been developing an asp.net mvc application where i need to make large amounts of jquery post and get request to call controller methods and get back json result. Everything is working fine.

The problem is i had to write different jquery post and get request url on local intranet(deployed by making virtual directory) and live server.

the current jquery request url is given as below:

$.post("/ProjectsChat/GetMessages", { roomId: 24 },..........

now this format of url for jquery request works fine for live server but not for local intranet. Since on local intranet i have made a virtual directory. It only works when i append the name of the virtual directory like this "$.post("MyProjectVirutalDirName/ProjectsChat..................."

I am sure most of you must have come across same problem.

now i have made a full project, there are large number of jquery requests made, i want to test the application by deploying on local intranet and fix the bugs. Changing all the jquery requests for local intranet doesn't seem feasible solution to me, i am really in a big problem, i can't deploy the same project on live server just like that and test it there, client will kill me.

I need some expert advice.

Please help

Thanks

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc