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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:10:13+00:00 2026-05-27T05:10:13+00:00

I need to load jQuery1.7 as module, I’ve seen this code of @jrburke :

  • 0

I need to load jQuery1.7 as module, I’ve seen this code of @jrburke:

requirejs.config({
  paths: {
    'jquery' : 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min'
  }
});

require(['jquery'], function($) {
  //$ points to jQuery
});

It’s not very useful for me, because all .js name are generated by server-side, I got them from php-array.

So, I wrote this:

require(['http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js'],
        function($) {
  //$ points to jQuery
});

But $ is null inside this function.

UPDATE:

Here is my php-template that render my js-scripts for this page:

<script src="http://requirejs.org/docs/release/1.0.1/minified/require.js">
</script>

<script> 
    require([
        <?php echo "'". implode("',\n\t'", $this->scripts) . "'\n"; ?>
    ], function($){

        console.warn ($); // null ;(

        // loaded jQuery
        window.$ = $;

        // Load main client script for this page
        boot( '<?php echo $this->eprint($this->content_page); ?>' );

    });
</script>

and it is my php-array for this page (page index):

$scripts = array(
    'http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js',
    'http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js',
    '/js/libs/jquery.history.js?v=1321687090',
    '/js/libs/coolclock.js?v=1321629683',
    '/js/libs/excanvas.js?v=1321629683',
    '/js/client.modules.js?v=1321703735',
    '/js/client.all.js?v=1322512192',
    '/js/boot.js?v=1322512037',
    '/js/client.index.js?v=1321689884'
);
  • 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-27T05:10:14+00:00Added an answer on May 27, 2026 at 5:10 am

    Have your php array of the form:

    $jquery = array (
       'jQuery' => 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js'
    );
    

    Then try:

    requirejs.config({
      paths: <?php echo json_encode($jquery) ?>
    });
    
    require(['jquery'], function($) {
      //$ points to jQuery
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to load a part of code dinamically by using Jquery and Json.
Two Delphi programs need to load foo.dll, which contains some code that injects a
i wonder if i use google.load(jquery, 1); google.setOnLoadCallback(function() { // i still need to
When loading a html page using JQuery load, I also need to call another
I need to load the jQuery UI files, and would like to do it
Across my application, I need to load a content block into a jQuery UI
I have: <p>Paragraph One</p> <p>Paragraph Two</p> <script src=http://www.google.com/jsapi></script> <script> google.load(jquery, 1); </script> <script> var
I am using jQuery .load() to load a php-file. This php-file echos out a
I'm experimenting with Modernizer.load. I have this: Modernizr.load([ { load : ['/js/jquery-1.6.1.js', '/js/jquery.tools.min.js', '/js/myscript.js']
I need to load usercontrol using jquery. I created a handler class and loaded

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.