Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6908081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:31:00+00:00 2026-05-27T08:31:00+00:00

$.ajax( { type: GET, url: ‘Home/GetMsg’, success: function (result) { }, error: function (req,

  • 0
$.ajax(
      {
    type: "GET",                    
    url: 'Home/GetMsg',                 
    success: function (result) {        },
    error: function (req, status, error) {}
     });    

By Default URL taking relative path for Home/GetMsg. I am calling this function from different controller/view which disturb the URL.
How can i mention absolute and relative path here. i did tried with
URL: ‘http://abc.com/Home/Getmsg’ but again its not working

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:31:01+00:00Added an answer on May 27, 2026 at 8:31 am

    Use a helper:

    url: '@Url.Action("GetMsg", "Home")',  
    

    or if this is in a separate javascript file where you cannot use server side helpers, you could use helpers to generate the url on some existing DOM element using HTML5 data-* attributes:

    <div id="foo" data-url="@Url.Action("GetMsg", "Home")">Foo</div>
    

    and then in your js:

    url: $('#foo').data('url'), 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$.ajax({ type: GET, url: awards.xml, dataType: xml, success: parseXml }); function parseXml(xml) { I
$.ajax({ type: 'GET', url: string.txt, cache: false, success: function(str){ alert(Data is: + str); }
So I currently use the following: $.ajax({ type: GET, url: file.php, success: function(html) {
I have the following code: $.ajax({ type: GET, url: AJAX.ashx?job=fetch_calendar, dataType: html, success: function
$.ajax({ type: GET, url: something.html, dataType: xml, success:function(data){} , }); The content while accessing
Consider: function ajaxCall(url, callback) { $.ajax({ type: GET, url: url, success: function (data) {
$.ajax({ type: GET, url: pages.php, data: hash=+s, dataType: html, success: function(msg){ $('#main').append(msg); } Works
$.ajax({ type:'GET', cache: 'false', url:/foo/, data:{id: pid}, success:function(data) { $('#wrapper').html(data); } }); <li id=btn-click
JS function loadXml() { $.ajax({ type: 'get', url: 'test.xml', dataType: 'xml', success: function(output) {
I'm using the following code: $.ajax({ type:'GET', url: 'save_desc.php?scrapbook_name=<?php print(addslashes($scrapbook_name)); ?>, success: function(data){ $(#

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.