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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:29:48+00:00 2026-06-12T10:29:48+00:00

I have an Ember application that is typically going to make ajax requests to

  • 0

I have an Ember application that is typically going to make ajax requests to a server to get its data. The issue I’m facing is that each request needs to have a signature appended to the URL. This signature needs to be calculated often as it is only valid for maybe 10 seconds. The system requires that I request this signature from a server, probably using an ajax request. So, my issue is that Ember can never use the signature returned from the ajax request because it’s not designed to wait around, as expected.

The code in question is here: http://jsfiddle.net/veDjq/

In that code, signature inside App.Post is always undefined though I can see that the request for the signature returns a correct value if I console.log the response in App.Signature.

I’m new to Ember so I am more than likely going about this wrong way. In the end, I need to be able to request a new signature each time an Ember object has to request data from the server. I’ve attempted to use jQuery’s $.ajaxSend to change the URL, but it doesn’t work on GET requests.

  • 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-12T10:29:48+00:00Added an answer on June 12, 2026 at 10:29 am

    Inside of your success handler, this is not what you think it is. It looks like you intend for this to be the App.Signature class. In order to make that the case, you can set the context option of the signature ajax call to this.

    I would also recommend looking into promises. They will help you clean up this code. For example (untested):

    App.Signature.reopenClass({
        retrieveSignature: function(){
            return $.ajax({
                url: '/auth/',
            });
        }
    });
    
    App.Post.reopenClass({
        postedPosts: [],
        find: function(){
            var postClass = this;
            var signaturePromise = App.Signature.retrieveSignature();
            signaturePromise.done(function(signature){
                var postsRetrieval = $.ajax({
                    url: 'http://someserver.com/1/posts/list.json?' + signature,
                    dataType: 'json'
                });
                postsRetrieval.done(function(response){
                    response.data.forEach(function(post){
                        postClass.postedPosts.addObject(App.Post.create(post))
                    });
                });
            });
            return this.postedPosts;
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a unique issue - I am designing a web application that creates
I have a hosted web application that has MongoDB as its DB. Now, I
I'm trying out Ember.js with ember-data, and I have the following application defined: window.App
I have a phonegap application targeting iPad that needs to embed a video on
Currently I have this code var App = Ember.Application.create(); App.user = Ember.Object.create({ people: customers
So I have an object of ArrayProxy kind var App = Ember.Application.create(); App.car =
I have an Ember.js app that has a Checklist model, where each Checklist has
I have a frame in a Delphi 2007 application that I want to embed
I have an application with different components that are accessible through a viewstack in
I have a ruby-on-rails application that wishes to utilise the tumblr gem for adding

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.