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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:26:52+00:00 2026-05-16T15:26:52+00:00

I am using Script# 0.6 and its newly added jQuery support, so far I

  • 0

I am using Script# 0.6 and its newly added jQuery support, so far I am very impressed.

In the C# I attach a click handler to a button like so

jQuery.Select("#myButton").Click(myHandler);

And it gets compiled into this JavaScript

$("#myButton").click(ss.Delegate.create(this, this.myHandler));

Is there anyway to get it compiled into

$("#myButton").click(this.myHandler);

Or even better

$("#myButton").click($.proxy(this.myHandler, this));

I realise that this is a minor issue but I would like to reduce the number of references to ss and other Script# dependencies since Script# is still in its early stages of development.

  • 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-16T15:26:52+00:00Added an answer on May 16, 2026 at 3:26 pm

    Functionally ss.Delegate.create(this, this.myHandler) is very different from this.myHandler. They provide different behavior. The former preserves the “this” object context, and the latter doesn’t.

    If your handler doesn’t need the “this” context, i.e. in c# terms, can be a static method, then make it so, and script# will emit the following instead:

    $("myButton").click(MyClass.myHandler)
    

    Hope that helps.

    There is no way to replace what gets generated, but you can (if you really want) write your own version of mscorlib.js or ss.Delegate – the compiler doesn’t care, as long as your implementation matches the contract it expects from the runtime script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using java-script function when i click a td the value is stored
Ok I'm using the jQuery Mobile framework and I would like to be able
I wonder who has programmed using avaloq script. What are its benefits? What is
I'm using a script to move files from one directory to another. It's also
Using the stored procedure sp_msforeachtable it's possible to execute a script for all tables
Using DBI::DatabaseHandle#execute or DBI::DatabaseHandle#prepare it's not possible to run an sql script (with mutiple
I have a script that generates images from text using PHP. It's working fine
I'm using DOMPDF to generate about 500 reports from one script. It's running out
I'm using Apple's EPFImporter tool http://www.apple.com/itunes/affiliates/resources/documentation/epfimporter.html It's a Python script that will take space
I'm using script language ChaiScript with c++ and Qt. I've defined such function: void

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.