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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:25:29+00:00 2026-06-09T14:25:29+00:00

I am using a test .json file and can console.log the url fine in

  • 0

I am using a test .json file and can console.log the url fine in the success, but I am trying to now append parameters to the url and they are being ignored.

This is what the view looks like, works fine and success message appears with a test json file:

busImportSearch: function() {
    importSelect.fetch({
        data: {
            importPhone: '5555555555',
            busImportName: 'test business',
            busImportCID: '12345',
            busImportBID: '1234567890'
        },
        success: function(results) {
            // url console.log's fine just no params
        }
    });
}

This is what I have in the collection:

var importSelect = Backbone.Collection.extend({
    model: importModel,

    url:'somepath/test.json',

    sync: function(method, model, options) {
        options.timeout = 10000;
    options.dataType = "json";
        return Backbone.sync(method, model, options);
    },

    parse: function(response) {
        console.log(this.url);
        if (typeof response.data !== 'undefined') {
            this.result = response.data.list;
         }
        return this.result;
     },
});

 return new importSelect;
});

Edit

I think this is working but I think there is a better way to do this:

url: function() {
  var busimportPhone = $("#busImportPhone").val();
  var busImportName = $("#busImportName").val();
  var busImportCID = $("#busImportCID").val();
  var busImportBID = $("#busImportBID").val(); 
  var updateUrl = 'test.json' + '?importPhone=' + busimportPhone + '&importName=' + busImportName + '&importCID=' + busImportCID + '&importBID' + busImportBID; return updateUrl;
},
  • 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-09T14:25:30+00:00Added an answer on June 9, 2026 at 2:25 pm

    This is not a whole lot better, but you could store the list of properties on the collection some where and create the url from there. Eg.

    importSelect.myDataList = {
            importPhone: '5555555555',
            busImportName: 'test business',
            busImportCID: '12345',
            busImportBID: '1234567890'
        };
    importSelect.fetch({ ... });
    

    And construct your url using a function something like (code not tested)

    function constructUrl(data) {
        var result = "";
        var count = 0;
        for(var i in data) {
           var prefix = "&";
           if(count == 0) {
               prefix = "?";
           }
           result += prefix + i + "=" + data[i];
        }
        return result;
    }
    

    and use function to create Url

    ...
    url: function() { 
        return constructUrl(this.data);
    }
    

    hope that helps.

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

Sidebar

Related Questions

Using google's json parser , i test file's content to see if it can
I have a JSON object that I am trying to read using Python but
I'm trying to load a local JSON file but it won't work. Here is
When testing a JSON response from an RSPEC controller test using DHH's JBuilder, my
Using this to load the json var jsonParsed = JSON.parse(localStorage.getItem('test')); Using this to save
I am using the Elasticsearch JSON Mapping as { mappings: { test: { _routing:
I'm trying to retrofit some tests using Test::More to legacy code and I've bumped
I have a json file. I am using it to store information, and as
I am using JQuery & JSON (POST) to call webmethod. However I can call
I'm new to ASP.NET but have quite a few successful test pages going now

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.