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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:32:34+00:00 2026-06-05T02:32:34+00:00

When I try to override the urlRoot attribute of a model and do a

  • 0

When I try to override the urlRoot attribute of a model and do a fetch on that model, the urlRoot actually returns the whole function as a string. Here is what the overridden urlRoot looks like:

urlRoot: function() {
  return "test";
},

It returns the following:
http://localhost:8000/items/function%20()%20%7B%20%20%20%20%20%20return%20%22test%22;%20%20%20%20%7D

Also, where does the items portion of the URL come from?

  • 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-05T02:32:35+00:00Added an answer on June 5, 2026 at 2:32 am

    URLRoot is expected to be a static string

    • defined either during construction or

    • during runtime

    You can override the URl as a function if a logic lies in construction of the url.

    Example

    Backbone.Model.extend({
    
    ..
    urlRoot:"test",
    url:function(){
    
    return this.urlRoot + "/" + this.cid;
    
    },
    ..
    
    }):
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to override the SubmitChanges() method for my model. Whern I try to
try: spam.foo except AttributeError: do_somthing() (Is it wise to check an attribute like that
Would it be possible to override the 'require' command so that it will try
I notice that sometimes when I try to override a CSS rule, browser does
Thread thread = new Thread(new Runnable() { @Override public void run() { try {
I've been trying to override the file login.xml but no matter what I try,
this is my thread: @Override public void run() { Log.d(ConnectionThread,Starting Server Connection); try {
I try to override this method and stuck with some problem public boolean onKeyDown(int
I try to create listView dynamically from code with: @Override public View getView(int position,
when I try to overload operator == and != in C#, and override Equal

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.