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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:18:36+00:00 2026-05-26T12:18:36+00:00

I have the following script: $ -> $(‘#new_event’).submit -> $.post( $(this).attr(‘action’) $(this).serialize() success: (data,

  • 0

I have the following script:

$ ->
    $('#new_event').submit ->
        $.post(
            $(this).attr('action')
            $(this).serialize()
            success: (data, textStatus, jqXHR) ->
                processData(data, textStatus, jqXHR)
        )
        return false

processData = (data, textStatus, jqXHR) ->
    alert(data)

and so far I can’t for the life of me debug this. It renders as:

(function() {
  var processData;
  $(function() {
    return $('#new_event').submit(function() {
      $.post($(this).attr('action'), $(this).serialize(), {
        success: function(data, textStatus, jqXHR) {
          return processData(data, textStatus, jqXHR);
        }
      });
      return false;
    });
  });
  processData = function(data, textStatus, jqXHR) {
    return alert(data); //BREAKPOINT HERE
  };
}).call(this);

which looks okay to me. If I put the breakpoint on alert it never stops there. My javascript knowledge is pretty limited so I’m obviously missing something here. Would love to know what’s happening.

Thanks,
Dany.

  • 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-26T12:18:37+00:00Added an answer on May 26, 2026 at 12:18 pm

    I think your CoffeeScript is okay but your $.post arguments are wrong. From the fine manual:

    jQuery.post( url [, data] [, success(data, textStatus, jqXHR)] [, dataType] )

    So you don’t use the success: fn(...) arguments with $.post, you just give it a function:

    $ ->
        $('#new_event').submit ->
            $.post(
                $(this).attr('action')
                $(this).serialize()
                (data, textStatus, jqXHR) ->
                    processData(data, textStatus, jqXHR)
            )
            false
    
    processData = (data, textStatus, jqXHR) ->
        alert(data)
    

    or even:

    $ ->
        $('#new_event').submit ->
            $.post(
                $(this).attr('action')
                $(this).serialize()
                processData
            )
            false
    
    processData = (data, textStatus, jqXHR) ->
        alert(data)
    

    or:

    $ ->
        $('#new_event').submit ->
            $.post(
                $(this).attr('action')
                $(this).serialize()
                (data, textStatus, jqXHR) ->
                    alert(data)
            )
            false
    

    if you don’t mind the extra indentation and don’t need processData elsewhere.

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

Sidebar

Related Questions

I have the following script: $('#divs').children().each( function(){ //Get Id's var id = $(this).attr('id').replace('id_',''); alert(id);
I have the following script: var queryString = $(#recurringForm).serialize(); var action = https://www.beanstream.com/scripts/recurring_billing.asp? +
I have the following script: $(document).ready(function() { $('#slideSelect').change(function(){ $('#slideViewer img').attr('src', $(this).val() + '.png'); });
i have the following script i am using to scrap data from my uni
I have the following script to logon to a url,but on submit in the
I have the following script: $('#element_1').live('click', function() { function_1(this) }); function function_1(that) { that
I have the following script: $("tr.member_profile_comment_row_frame").mouseover(function () { $(this.element."img.member_profile_comment_show_delete_button").show(); }); $("tr.member_profile_comment_row_frame").mouseout(function () { $(this.element."img.member_profile_comment_show_delete_button").hide();
I have the following script: function drawDimensions(divid) { $.getJSON('dimensions.json', function(data) { $.each(data, function(index) {
I have the following script: $(.Text).contents().each(function () { $(this).replaceWith($(this).text() .replace(/\[([^\]]*)\]/g, '<span class=IT_Symbol style=display:inline;border: 1px
I have the following script. It replaces all instances of @lookFor with @replaceWith in

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.