Skip to content

Commit cc0c64d

Browse files
committed
Add GCF meta tag, update baseUrl refs in docs to not include slash, document that JSONP support is restricted to objects only. Closes requirejs#60
1 parent 8ee9a94 commit cc0c64d

7 files changed

Lines changed: 18 additions & 21 deletions

File tree

dist/pre.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
<html>
33
<head>
44
<title>RequireJS</title>
5+
6+
<meta http-equiv="X-UA-Compatible" content="chrome=1">
7+
58
<link rel="stylesheet" type="text/css" href="main.css">
69
<link rel="icon" type="image/x-icon" href="/favicon.png">
710
<!--[if IE]> <link rel="stylesheet" type="text/css" href="ie.css" /> <![endif]-->
811
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojox/highlight/resources/highlight.css">
12+
913
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
1014
<script type="text/javascript" src="init.js"></script>
1115
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"></script>

docs/api.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ <h3><a name="jsonp">Specify a JSONP Service Dependency</a><span class="sectionMa
422422

423423
<p>This use of JSONP should be limited to JSONP services for initial application setup. If the JSONP service times out, it means other modules you define via define() may not get executed, so the error handling is not robust.</p>
424424

425+
<p><strong>Only JSONP return values that are JSON objects are supported</strong>. A JSONP response that is an array, a string or a number will not work.</p>
426+
425427
<p>This functionality should not be used for long-polling JSONP connections -- APIs that deal with real time streaming. Those kinds of APIs should do more script cleanup after receiving each response, and RequireJS will only fetch a JSONP URL once -- subsequent uses of the same URL as a dependency in a require() or define() call will get a cached value.</p>
426428

427429
<p>Errors in loading a JSONP service are normally surfaced via timeouts for the service, since script tag loading does not give much detail into network problems. To detect errors, you can override require.onError() to get errors. The error object passed to the onerror function will contain two properties if it is a timeout issue:</p>
@@ -475,7 +477,7 @@ <h2>
475477
<pre><code>&lt;script type="text/javascript" src="scripts/require.js"&gt;&lt;/script&gt;
476478
&lt;script type="text/javascript"&gt;
477479
require({
478-
baseUrl: "/another/path/",
480+
baseUrl: "/another/path",
479481
paths: {
480482
"some": "some/v1.0"
481483
},
@@ -813,7 +815,7 @@ <h3><a name="multiversion">Multiversion Support</a><span class="sectionMark">&se
813815
&lt;script type="text/javascript"&gt;
814816
require({
815817
context: "version1",
816-
baseUrl: "version1/"
818+
baseUrl: "version1"
817819
},
818820
["require", "alpha", "beta",],
819821
function(require, alpha, beta) {
@@ -833,7 +835,7 @@ <h3><a name="multiversion">Multiversion Support</a><span class="sectionMark">&se
833835

834836
require({
835837
context: "version2",
836-
baseUrl: "version2/"
838+
baseUrl: "version2"
837839
},
838840
["require", "alpha", "beta"],
839841
function(require, alpha, beta) {

docs/faq-advanced.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h4>1) Modify the source of require.js</h4>
2626
//just use an simple object literal, {}. You may need
2727
//to at least set baseUrl.
2828
var require = {
29-
baseUrl: '../'
29+
baseUrl: '..'
3030
};
3131

3232
//INSERT require.js CONTENTS HERE

docs/jquery-require-sample/webapp/scripts/app.build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
({
22
appDir: "../",
3-
baseUrl: "scripts/",
3+
baseUrl: "scripts",
44
dir: "../../webapp-build",
55
//Comment out the optimize line if you want
66
//the code minified by Closure Compiler using

docs/jquery.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ <h2>
106106

107107
<pre><code>({
108108
appDir: "../",
109-
baseUrl: "scripts/",
109+
baseUrl: "scripts",
110110
dir: "../../webapp-build",
111111
//Comment out the optimize line if you want
112112
//the code minified by Closure Compiler using

docs/optimization.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ <h2><a name="wholeproject">Optimizing a whole project</a><span class="sectionMar
192192

193193
<pre><code>({
194194
appDir: "../",
195-
baseUrl: "scripts/",
195+
baseUrl: "scripts",
196196
dir: "../../appdirectory-build",
197197
modules: [
198198
{
@@ -244,7 +244,7 @@ <h2><a name="hasjs">Integration with has.js</a><span class="sectionMark">&sect;
244244

245245
<pre><code>
246246
({
247-
baseUrl: "./",
247+
baseUrl: ".",
248248
name: "hasTestModule",
249249
out: "builds/hasTestModule.js",
250250
has: {

tasks.txt

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ Release Notes
66
* Node adapter now assumes old node modules always on require.paths: em.com.
77

88
- Update documentation for new tools.
9+
- Document that JSONP support only works with objects: https://github.com/jrburke/requirejs/issues/#issue/60
10+
- Update AMD page to mention require scanning means only do them at the top.
11+
- Update docs to mention r.js is rhino and node adapter?
912

1013
- update to jQuery 1.5: or just put in the version detection?
1114

12-
- Remove / from baseUrl examples.
13-
14-
- Update docs to mention r.js is rhino and node adapter?
15-
1615
- "libs/static.lib.02", //kaaahhhhnnnn!!!
1716
- build jquery, but use allplugins file, specify an order dependency,
1817
the build breaks because of partial order! plugin evaluation. Need to
@@ -21,6 +20,7 @@ Release Notes
2120

2221
- .js removal from main packages config?
2322
- data-main change/baseUrl change?
23+
- baseUrlMatch is no longer needed?
2424

2525
- Build the optimizer as its own project, at least enough to take out the
2626
work from jquery-require-sample
@@ -40,8 +40,6 @@ Release Notes
4040

4141
- Update copyrights to 2011
4242
- How to use with Dojo page: http://trac.dojotoolkit.org/ticket/12200
43-
- Document that JSONP support only works with objects: https://github.com/jrburke/requirejs/issues/#issue/60
44-
- add gcf to pages
4543

4644
- From Richard Backhouse: As an FYI I have been doing my own investigation of using UglifyJS for compression
4745
and one thing I found when trying to compress dojo 1.5 code was that I had ensure that "make_seqs"
@@ -51,8 +49,6 @@ flag was set to false when calling ast_squeeze. If I left this flag set to true
5149

5250
- Don't put use strict at the top of files? https://github.com/jrburke/requirejs/issues#issue/61
5351

54-
- Update AMD page to mention require scanning means only do them at the top.
55-
5652
- Build with requireplugins-jquery.js uses bad definition for require/text, probably other plugins. Use a jqueryStub.js
5753
for builds that need it with plain define, and allow the build system to load
5854
the plugins. A problem, since previously built layers with plugins in them
@@ -69,11 +65,6 @@ flag was set to false when calling ast_squeeze. If I left this flag set to true
6965

7066
- ending slash in paths should throw error: https://github.com/jrburke/requirejs/issues/issue/49/
7167

72-
- John's email about an error callback, also allow loader to abort a plugin-loaded resource?
73-
74-
- jquery/jqueryDynamic2.html in IE8: sometimes if using cache, the jquery ready callbacks do not fire,
75-
even though we seem to indicate it correctly? Trace latest jQuery 1.4.4.
76-
7768
- Document new closure compiler options from neonstalwart
7869
- require.modify alternative syntax/patch.
7970
- has.js plugins

0 commit comments

Comments
 (0)