• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to return non-XML text from an ASP script?

Community Beginner ,
Oct 24, 2019 Oct 24, 2019

Copy link to clipboard

Copied

My HTML5 Canvas needs to check for user authentication, so it queries an asp script for a session status result (just a simple string).  But I am not able to get it to work.  I have created a simple testing asp script:

 

 

<%
response.write "GOT_HERE" 
%>

 

 

I can confirm this script returns 'GOT_HERE' to the screen when loaded directly in the browser.

 

I attempt to query it in my canvas via:

 

 

$('#dom_overlay_container').on('click', '#button1', function() {
			
			this.myDynText.text = "Step 1";
				
			  var xhttp = new XMLHttpRequest();
		
			  xhttp.onreadystatechange = function() {
				  this.myDynText.text = "Step 2";				  
				  if (this.readyState == 4 ) {
					this.myDynText.text = this.responseText;					
				}
			  };
			  xhttp.open("GET", "TEST.asp", true);
			  xhttp.send();
			
		}.bind(_this));

 

 

I successfully get to Step 1, but not Step 2.  Any idea what's wrong?

 

Thanks,
Geoff

TOPICS
Code

Views

133

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 24, 2019 Oct 24, 2019

Copy link to clipboard

Copied

I found the problem!  In my funciton, 

 

this.myDynText.text 	

 

should be

 

_this.myDynText.text 

 

 

Geoff

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 24, 2019 Oct 24, 2019

Copy link to clipboard

Copied

LATEST

Would anyone have a moment to explain why?  I don't understand the scope of this, _this, that, etc.

 

Thanks,
Geoff

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines