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 6851711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:16:53+00:00 2026-05-27T01:16:53+00:00

I am forming some java script code like this var url = ‘<%= Server.MapPath(.)

  • 0

I am forming some java script code like this

 var url = '<%= Server.MapPath(".") %>' + '/Variablesvariable.txt';
 alert(url);
 xmlhttp.open("GET", url , true); //  url +'/Variables/variable.txt'
 xmlhttp.send();
//alert('<%= Server.MapPath(".") %> \Variablesvariable.txt')

whats wrong with this?

the URL don’t pass to method proper, at open method it get crashes, so am i forming the wrong URL, or some other way exist in the java script to concatenate it?

I see URL in add watch

it is forming like this

" url\"D:VisualStudio2010ProjectsWebSitesTinyEditor/Variablesvariable.txt\""

whats wrong?

  • 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-27T01:16:54+00:00Added an answer on May 27, 2026 at 1:16 am

    <%= Server.MapPath(".") %>

    This generates a physical path like c:somefolder. What you need to pass in is a url which is available on the web so something like /myfolder/Variablesvariable.txt.

    So make it up like:

    var url = '/myfolder/variables.txt';
    alert(url);
    

    Where you place the file variables.txt into a subfolder myfolder of your web application.

    If you want to have it more dynamic you can do like this in your codebehind:

    protected void Page_Load(object sender, EventArgs e)
    {
        VariableUrl = ResolveUrl("~/Scripts/variables.txt");
    }
    
    public String VariableUrl { get; set; }
    

    and in the markup:

    var url = '<%= VariableUrl %>';
    alert(url);
    

    So what you put as parameter into the ResolveUrl method is entirely up to you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am porting some Java code to Python and we would like to use
Based on some code in a lecture by Doug Crockford, I've created this. var
I've had some trouble forking of processes from a Perl CGI script when running
I'm doing some Javascript scripting with InDesign Server at the moment. I'm having trouble
I have a script that retrieves objects from a remote server through an Ajax
It seems to me that, in some ways, Java is where C was a
I run a lot of java code on my servers, and occasionally I get
Some of the NHibernate queries are forming as below, I am just using the
This is an interview question I saw on some site. It was mentioned that
Yesterday I red this article about the new Exception Handling in Java 7. In

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.