New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Page load sample: In-Memory broken in IE7 #3185

Closed
ernieracer opened this Issue Nov 28, 2011 · 3 comments

Comments

Projects
None yet
2 participants
@ernieracer

The In-Memory dynamic page loading sample is broken in IE7.

it throws the following exception:

SCRIPT1028: Expected identifier, string or number
sample-reuse-page.html, line 22 character 4

link is on the following page:
http://jquerymobile.com/demos/1.0/docs/pages/page-dynamic.html

and points to:
http://jquerymobile.com/test/docs/pages/dynamic-samples/sample-reuse-page.html

The reason is that IE7 doesn't allow trailing commas in object notations.

The following fixes the issue:

change:

var categoryData = {
animals: {
name: "Animals",
description: "All your favorites from aardvarks to zebras.",
items: [
{
name: "Pets",
},
{
name: "Farm Animals",
},
{
name: "Wild Animals",
}
]
...

to:

var categoryData = {
animals: {
name: "Animals",
description: "All your favorites from aardvarks to zebras.",
items: [
{
name: "Pets"
},
{
name: "Farm Animals"
},
{
name: "Wild Animals"
}
]
...

Even though JavaScript does allow trailing commas in objects and arrays (which makes the sample valid JavaScript code for non-IE7 browsers), the JSON specification to my knowledge does not.

I would also fix the sample code on http://jquerymobile.com/demos/1.0/docs/pages/page-dynamic.html .

Daniel

jblas added a commit that referenced this issue Nov 28, 2011

Fix for #3185 - Dynamic Page load sample: In-Memory broken in IE7
- Removed trailing commas that choke IE.
@jblas

This comment has been minimized.

Show comment
Hide comment
@jblas

jblas Nov 28, 2011

Contributor

@ernieracer

Thanks for reporting and figuring it out. Fix landed on the HEAD:

ed05ff8

Contributor

jblas commented Nov 28, 2011

@ernieracer

Thanks for reporting and figuring it out. Fix landed on the HEAD:

ed05ff8

@jblas jblas closed this Nov 28, 2011

@ernieracer

This comment has been minimized.

Show comment
Hide comment
@ernieracer

ernieracer Nov 28, 2011

No problem, you're welcome Kin, thank you too!

by the way, personally, I would change the docs as well:

http://jquerymobile.com/demos/1.0/docs/pages/page-dynamic.html
https://github.com/jquery/jquery-mobile/blob/master/docs/pages/page-dynamic.html

Daniel

No problem, you're welcome Kin, thank you too!

by the way, personally, I would change the docs as well:

http://jquerymobile.com/demos/1.0/docs/pages/page-dynamic.html
https://github.com/jquery/jquery-mobile/blob/master/docs/pages/page-dynamic.html

Daniel

jblas added a commit that referenced this issue Nov 28, 2011

Fix for #3185 - Dynamic Page load sample: In-Memory broken in IE7
- Removed trailing commas that choke IE from the docs.
@jblas

This comment has been minimized.

Show comment
Hide comment
@jblas

jblas Nov 28, 2011

Contributor

Hey Daniel,

Thanks for pointing that out to me. Fixed too.

d9983d7

Contributor

jblas commented Nov 28, 2011

Hey Daniel,

Thanks for pointing that out to me. Fixed too.

d9983d7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment