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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:41:58+00:00 2026-05-30T21:41:58+00:00

I set the data-main for Requirejs and according to the documentation that should set

  • 0

I set the data-main for Requirejs and according to the documentation that should set the baseUrl for all my script files. But this is not the case.
My folder structure is this:

Home/Index.html
Content/scripts/main.js
Content/scripts/libs/require/require.js
Content/scripts/libs/jquery/require_jquery.js
Content/scripts/libs/jquery/jquery-1.7.1.mins.js

Here is the script tag in my Index.html:

<script data-main="/PAWS/Content/scripts/main.js" src="/PAWS/Content/scripts/libs/require/require.js" type="text/javascript"></script>

I would assume it would set my baseUrl to /PAWS/Content/scripts/ but its not working for me. In my main.js I do this:

require(
    { paths: 
        {   jquery: 'libs/jquery',
            knockout: 'libs/knockout'
        }
    },

    ['jquery/require_jquery'],


    function ($) { .... }
);

In my require_jquery.js file I do this:

define(["libs/jquery/jquery-1.7.1.min.js"], function () {
    return jQuery;
});

But I get a 404 error saying that:

GET http://localhost/PAWS/Home/libs/jquery/jquery-1.7.1.min.js 404 NOT FOUND

You see.. my baseUrl should be /PAWS/Content/scripts… But it totally ignores my data-main attribute setting and just resolves /PAWS/Home/ to be the baseUrl. What am I doing wrong?

  • 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-30T21:41:59+00:00Added an answer on May 30, 2026 at 9:41 pm

    From the RequireJS API docs:

    However, if the dependency name has one of the following properties, it is treated as a regular file
    path, like something that was passed to a <script src=""> tag:

    • Ends in “.js”.
    • Starts with a “/”.
    • Contains an URL protocol, like “http:” or “https:”.

    From this, it appears that your explicit “.js” on the end of libs/jquery/jquery-1.7.1.min.js is confounding your path re: baseUrl. Try libs/jquery/jquery-1.7.1.min instead.

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

Sidebar

Related Questions

I'm trying to set data in long-term storage in a GreaseMonkey script, except that
I can set data in JTable constructor, and then user can change this data
Given this data set: ID Name City Birthyear 1 Egon Spengler New York 1957
Given a data set like this; +-----+---------------------+--------+ | id | date | result |
Imagine a web application that performs two main functions: Serves data from a file
I have a set of data that has been displayed as just a simple
I have a Host Javascript Application, which not use AMD, BackboneJS or RequireJS but
We have a system that allows users interfacing data into the database to set
I always think of xml like a set data structure. Ie: <class> <person>john</person> <person>sarah</person>
I'm using a particular database table like a Set data structure, i.e., you can

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.