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

  • Home
  • SEARCH
  • 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 4088568
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:59:56+00:00 2026-05-20T18:59:56+00:00

similar: Inserting objects into global scope in classic ASP / Javascript Trying to get

  • 0

similar: Inserting objects into global scope in classic ASP / Javascript


Trying to get started with using javascript in classic ASP. Seem to be some “gotchas” with this though: can anyone with some experience in this tell me what’s up with the “Blah2” code ? Seems like it “should” work but there seems to be a problem with my use of “this”…

<script language="javascript" runat="server">

 var Blah = {};
 Blah.w = function(s){Response.write(s);}

 Blah.w('hello'); //this works...


 var Blah2 = function(){
     this.w = function(s){Response.write(s);} 
     //line above gives 'Object doesn't support this property or method'
     return this;
 }();

 Blah2.w('hello');

</script>

Thanks for any pointers

Tim

  • 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-20T18:59:57+00:00Added an answer on May 20, 2026 at 6:59 pm

    You need parens around your function

    var Blah2 = (function(){
        this.w = function(s){Response.write(s);} 
        //line above gives 'Object doesn't support this property or method'
        return this;
    }());
    

    Also, this.w isn’t doing what you want. this is actually pointing to the global object right there. You want:

    var Blah2 = (function(){
        return {w : function(s){ Response.write(s); }};
    }());
    

    Or

    bar Blah2 = new (function(){
       ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I'm trying to implement some kind of object stream, similar to the structure
I am inserting records through a query similar to this one: insert into tbl_xyz
What's faster: inserting into a priority queue, or sorting retrospectively? I am generating some
I wonder if there is a way to synchronize objects/methods in JavaScript in a
Beyond work, some friends and I are trying to build a game of sorts;
Can anyone point me in the right direction of some real world object-orientated javascript?
Similar to my last question, but I ran into problem lets say I have
How do you get around the exponential conversion that takes place when inserting a
I am trying to implement something similar to the flight control game. There will
Im currently using OleDBCommand.ExecuteNonQuery (repeatedly called) to insert as much as 350,000 rows into

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.