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 8704461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:06:42+00:00 2026-06-13T03:06:42+00:00

I have been using Backbone a lot lately and love it because it keeps

  • 0

I have been using Backbone a lot lately and love it because it keeps my code clean.

I am just building another site and I really want to use some of the backbone / coffeescript syntax. For example for a one page loader I was thinking of doing something like this:

This is a single HTML page that loads one JavaScript file

#query Events    
$(document).ready =>

  $(".click").click ->
    console.log "hello"
    alert()


#Functions

  alert: ->
    console.log "alert"

So I can split all my functions neatly below and the events at the top. So I can keep track. In the above example I am trying to get the click event to fire on alert.

In backbone I can have an events list which trigger alerts, which I find really useful. But I do not need all the views / controllers / models etc.

At the moment though this does not work. What is the best way to have an event fire another function outside of its own function?

Maybe I am doing this really wrong, but I love the simplicity of splitting this up and keeping it clean.

  • 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-06-13T03:06:43+00:00Added an answer on June 13, 2026 at 3:06 am

    Okay so i messed up my syntax quite a bit…

    $(document).ready ->
      $(".click").click ->
        console.log "hello"
        alert()
    
      alert = ->
        console.log "alert"
    

    Works, if anyon else is looking to do this then this has worked for me 🙂

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

Sidebar

Related Questions

I have been using Backbone.js to act as a middleman between Wordpress (using the
I have been using CI just fine using the MySQL driver. I want to
I have been looking at backbone.js/spine.js and I like the idea of just setting
I just started learning Backbone.js, and have been working on (what else) a simple
I have been using this script for a while and suddenly it just stopped
I have been using Automapper in our projects and just recently ran into an
I have been using Backbone on a new project and so far have loved
I have been using namespaces to package my JavaScript code. In some of the
I have been using PHP and JavaScript for building my dad's website. He wants
Background I have been using Backbone.js for some time and one aspect of it

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.