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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:17:15+00:00 2026-06-09T07:17:15+00:00

I have created a class using an object as well as using Jquery 1.7.2.

  • 0

I have created a class using an object as well as using Jquery 1.7.2. My Jquery for everything works fine EXCEPT AJAX related calls such as “$.ajax()” and “$.getJSON()”.

I usually don’t create classes via objects or functions because of not worrying about scope. I do think it’s a scope issue, but I’m not sure how to fix it since I have a good chunk of other Jquery code being used without a hitch. So the issue seems to be focused around Ajax is setup in JQuery.

Below is some of the Javascript code. Not all because it would be a massive amount, and all the Jquery uses in the rest of the code, such as binding(), click(), .each().

There is more to the HTML, as well as to the JavaScript that has everything working except the Ajax call. HTML, CSS, and Javascript have been validated. Which is why I keep thinking it’s a scope issue.

HTML

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <link rel="stylesheet" href="_res/css/main.css" />
        <script src="_res/js/libs/jquery-1.7.2.min.js"></script>
        <script src="_res/js/libs/main.js"></script>
    </head>
    <body></body>
</html>

Javascript Snippet Code (main.js)

var BettingApp = {
    loadData:function()
    {
        //console.log("loadData()");

        //BettingApp.resetData();

        // This fails before it even tries to get the data.
        $.ajax(
        {
            url: "/_res/json/sampleData.json", 
            cache: false,
            contentType:"json",
            processData: false,
            complete: BettingApp.parseData,
            success: BettingApp.parseData
        });
    },

    resetData:function()
    {
        console.log("resetData()");
        // This works just fine
        $("#agencyBetView ul li").remove();
        $("#playerBetView ul li").remove();
    },

    activateData:function()
    {
        console.log("activateData()");
    }
};

$(document).ready(function(){ BettingApp.loadData(); });

Error from Browsers (Latest Chrome, Safari, Firefox)

Uncaught TypeError: Property 'String' of object [object Window] is not a function

jquery-1.7.2.min.js:2
e.extend.type jquery-1.7.2.min.js:2
f.Callbacks.n jquery-1.7.2.min.js:2
f.Callbacks.p.add jquery-1.7.2.min.js:2
f.extend.ajax jquery-1.7.2.min.js:4
BettingApp.loadData main.js:175
BettingApp.updateStep main.js:102
BettingApp.chooseBetType_agency main.js:369
f.event.dispatch jquery-1.7.2.min.js:3
f.event.add.h.handle.i

Jquery Functions Working in FULL Code

.bind()
.click()
.data()
.each()
.focus()
.focusout()
.html()
.ready()
.remove()
.slideUp()
.slideDown()
  • 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-09T07:17:17+00:00Added an answer on June 9, 2026 at 7:17 am

    From the error Property 'String' of object [object Window] is not a function it means you overwrite window.String, as shown below String is actually being overwritten, by "fast" and at the very end by ""

    animSpeed:String            = "fast",
    voucherID_step:Number       = 1,
    voucherID_target:String     = "#voucherIDView",
    noCredits_step:Number       = 2,
    noCredits_target:String     = "#noCreditsView",
    chooseBetType_step:Number   = 3,
    chooseBetType_target:String = "#chooseBetTypeView",
    agencyBet_step:Number       = 4.1,
    agencyBet_target:String     = "#agencyBetView",
    playerBet_step:Number       = 4.2,
    playerBet_target:String     = "#playerBetView",
    confirmation_step:Number    = 5,
    confirmation_target:String  = "#confirmationView",
    
    // Steps
    step:Number                 = 0,
    
    // VoucherID
    voucherIDDefaultText:String = "",
    

    You don’t need to specify variable types in javascript(actually you cant),I think this is what you meant

    animSpeed:           "fast",
    voucherID_step:          1,
    voucherID_target:        "#voucherIDView",
    noCredits_step:          2,
    noCredits_target:        "#noCreditsView",
    chooseBetType_step:      3,
    chooseBetType_target:    "#chooseBetTypeView",
    agencyBet_step:          4.1,
    agencyBet_target:        "#agencyBetView",
    playerBet_step:          4.2,
    playerBet_target:        "#playerBetView",
    confirmation_step:   5,
    confirmation_target:     "#confirmationView",
    
    // Steps
    step:                0,
    
    // VoucherID
    voucherIDDefaultText:    "",
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a Class Library (Core Processing Component) using C# in Visual Studio
I have created a UML diagram and generated a class by using Generate Code
I am using C#. I have created a class which can be included in
i am creating a process using System.DIagnostics.Process in c# i have created a class
I am using the apache library. I have created a class which sends a
I have certificate created using java class CertAndKeyGen and X500Name and I am able
i have created a process using the Process class. now i need to restrict
I have created a class that I've been using as the storage for all
I have a REST API using Spring. I've created an Interceptor: @Component public class
I am using the webapplicationbuilder class to create a new web application and have

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.