0

I am trying to execute a javascript and there is this error thrown:

Timestamp: 10/25/2012 2:23:13 PM
Error: SyntaxError: syntax error
Source File: http://www.facebook.com/dia.makoetskiy
Line: 1
Source Code:
<!DOCTYPE html> 

It points to this line.. althought it is not line 1 in the document.

<script src="http://www.facebook.com/dia.makoetskiy" onload="logged()" onerror="notlogged()"></script>

Whats the problem with firefox?

Chrome says that I have a syntax error:

<!DOCTYPE html>

Why is it an error..? why the hole page crashes on firefox but it is okay on chrome/

I think the error of the first line is from facebook.. but how do I prevent this? it retrieves the document from that page, and that document ruins the javascript external link syntax

Dmitry Makovetskiyd
  • 6,942
  • 32
  • 100
  • 160

2 Answers2

3

http://www.facebook.com/dia.makoetskiy is an HTML document, not a JavaScript program.

<!DOCTYPE html> is line one of that resource, not the document containing the <script> element.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
0

Facebook does not return a 404 response for non existent pages like http://www.facebook.com/some-super-bogus-username

http://redbot.org/?uri=http%3A%2F%2Fwww.facebook.com%2Fsome-super-bogus-username

It simply reports back HTTP/1.1 302 Found

And besides doing such a check with javascript is not ideal. Easy way to test a URL for 404 in PHP?

Community
  • 1
  • 1
Anthony Hatzopoulos
  • 10,437
  • 2
  • 40
  • 57