dynamically getting base url inside js file

Posted by uzay95 on Stack Overflow See other posts from Stack Overflow or by uzay95
Published on 2010-03-29T17:12:02Z Indexed on 2010/03/29 17:33 UTC
Read the original article Hit count: 609

Filed under:
|
|

I eant to run function inside web service (.asmx file)

    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: '/Admin/WebSrvcs/Management.asmx/f_SearchLabel',
        data: "{_sQuery:'" + obj.value + "'}",
        dataType: "json",

But I don't know where will be my root url(http://localhost:4399/VirDir or something else it may be) address inside js file. And i need to reach root folder of application to find asmx file.

    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: 'http://localhost:4399/virDir/Admin/WebSrvcs/Management.asmx/f_SearchLabel',
        data: "{_sQuery:'" + obj.value + "'}",
        dataType: "json",

I am working on Visual Studio 2008 and building web site with C#.

any help would be greatly appreciated

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about c#