Put the result of ajax call into a variable

I have two pages to which we will call pages "A" and "B". Page A is at the root of the server, which does not have access to ASP, while page B can do ASP because it is not in the root directory. What I need to do through ajax is send a request to page B from page A to get the day of the week from the server and put it in a variable for further testing on page A.

This is what I have on every page. The code is clearly incomplete on both pages, but I'm stuck with what to do next, or even if I go in the right direction.

Code Page ...

$.get("/v/vspfiles/date.asp"); 

B code page ...

 <%@LANGUAGE="VBSCRIPT"%> <% Option Explicit %> <%=WeekDayName( Weekday( Date ) )%> 

I see ajax call and response in firebug, so I know this part works, but I don’t know how to do the rest. Any help is appreciated.

+4
source share
1 answer

I hope I understood your question correctly, but if you want to get the text answer "/v/vspfiles/date.asp", then the correct way:

 $.get("/v/vspfiles/date.asp", null, function(response) { /* Here you can use response, which will contain the page text */ }); 
+1
source

All Articles