Put result of ajax call in a variable
I have two pages we will call page "A" and Page "B". Page A in the root of the server which does not have any ASP access, while page B can do ASP cause it is not in the root directory. What I need to do via ajax is to 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 so far on each page. The code is obviously incomplete on both pages but I am stuck on what to do next or if I am even going in the right direction.
Page A code...
$.get("/v/vspfiles/date.asp");
Page B code...
<%@LANGUAGE="VBSCRIPT"%>
<% Option Explicit %>
<%=WeekDayName( Weekday( Date ) )%>
I see the ajax call and response in firebug so I know that part is working but do not know how to do 开发者_高级运维the rest, Any help is appreciated.
I hope I understood your question correctly, but if you want to get the text response of "/v/vspfiles/date.asp" then the correct way is:
$.get("/v/vspfiles/date.asp", null, function(response) {
/* Here you can use response, which will contain the page's text */
});
精彩评论