Using consolelog for debugging with Classic ASP

I am looking at a webpage written in classic ASP and I am in the middle of a "while" statement. I want to use Chrome Developer tools to debug values ​​in my page. I tried to insert

console.log(value);

      

which works with C # apps, but it typed Expected end of statement

into the line console.log

I pasted.

I'm just looking for a quick tip on how to use the classic asp debugger?

+3
debugging while-loop console.log asp-classic


source to share


2 answers


You will need a Response.Write script using the console.log statement. Assuming the ASP page is outputting html.



+6


source to share


I do this with a function that returns javascript console.log () and it works fine for me in most used browsers (IE 10, Chrome, FireFox).

function aspLog(value)
    response.Write("<script language=javascript>console.log('" & value & "'); </script>")
end function

      

Then just call it in your asp page (or functions.asp file):



aspLog("Test text")
aspLog(100.0)

      

Unfortunately, this causes the generated html to be filled with javascript tags. Therefore, do not forget to comment or remove the theses of the aspLog () function calls when the code is ready.

+12


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics