I am pulling more results from a database using getJSON/jQuery. The link works fine in Chrome, but in IE 9 I get the following error: "SCRIPT1002: Syntax error index2.php, line 2 character 1" which points to:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

However even if I remove the DOCTYPE it just complains about the following line, so I really don't think the DOCTYPE is the issue.

What's weird is that the "+ Show More" link works for the first three times you click it, then it stops working. I'm guessing this is because of the "Sytax Error" it is complaining about.

You can see what i'm talking about here: http://www.trucktirewholesale.com/tires/index2.php

Any help is appreciated. I've been pulling my hair out for over an hour now.

Troy III commented: but I'm down voting your maliciousness -2

Recommended Answers

All 7 Replies

http://i44.tinypic.com/dr9vlh.png
I cant even see the "show more" anywhere on your supposedly working browser let alone be able to fix it in explorer.

p.s:
1. linked scripts on the header load async., you slideto.js may be loading faster!
2.I suggest you always use ";" in front of self invoking functions, - I mean always. i.e:

;(function($){
$.fn.slideto = function(options) {
//and its never ever a bad idea to also finish it with one
);

I'm saying this for the first time in public and its a great advice.

3. and lastly -please check if the jQuery file is in the right place.
{now that I've checked, none of them are ! They are missing, try moving them on your own domain ajax google apis are either refusing to serve you, or are down or perhaps IE is refusing to load cross-domain scripts. But the same is happening with chrome:
Failed to load resource https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js ...
}

Thanks for the quick reply. I have moved all jquery onto my domain. I tried using a ';' in front of the slideto function, but then it just breaks the slideto all together. However, I can completely remove the slideto.js, and I still get the error as I described before. I would be interested to hear more on what putting a semicolon infront of a function does? - I am still very much in the learning stages of jQuery/ajax so any help is greatly appreciated. You should now at least be able to see the "Show More" link to see what IE9 is spitting out.

Thanks again!

1. Sorry for googleapis, my computer was blocking it... (had some attacks from there)

2. This:

;(function($){
$.fn.slideto = function(options) {
...

should not break a thing ever.
its an amulet-like syntax that will always guard you from unepected js voodoo.

() [parens] can interact in a great distance and some comment might be fooling you that the line break is an established fact, but it might just so happen that an external script at the end of all lines didn't have a line terminator and might have even been omitted knowing that its the end of the file that will terminate not only the line but the script as a whole. But that's not the case -because external scripts will all be appended as if residing in one single and uninterrupted document. So if another js file begins with (... without a leading ; it will be considered a function call of some end-declaration from the previous file.


3. Why don't you try correcting the:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.0 Strict//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

into

<!DOCTYPE html>
<html lang="en">

first, -and see what happens...
Anyway, you'll need some patience because this error will not be easy that to locate...;

in jquery-ui.min.js I've noticed an unnecessary line termination in code

...[0].offsetWidth,
height:d[g]...

which depending on the parser - might also cause problems.

And sorry for asking but...:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.0 Strict//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<a id='cart' href='/tires/cart'> Your Cart - (empty)</a><head>
	<title>Tires - Wholesale</title>

Why is that (red) line of code sitting there.
Syntax Error report is absolutely correct 2 line <a> tag in the document head;
Did you do this deliberately? Because I'm pretty sure you did...

I honestly don't know how that link got above the header. I have been doing a lot of shuffling around. I actually just completely took index2.php down to the bare minimum. I removed all css. Got rid of the slideto.js. Even stripped down what is being returned in the JSON objects. Still can't pin point where this error is coming from. Just adds to my list of why i absolutely despise IE.

I really appreciate all your input.

And probably have no idea where did; nor when did xhtml4.0 came out neither?!
Mark the thread as solved and stop spamming the forum. IE will forgive an omission or two but will not tolerate the ignorance of an evil man.

Sorry for making a typo there Tommy-Too-Tough. SOLVED.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.