PDA

View Full Version : Facebox doctype issue



chechu
08-11-2008, 03:59 PM
1) Script Title: Facebox Image and Content Viewer

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/facebox/index.htm

3) Describe problem: In the instructions, I need to place the following in the <head> section;

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

But my site has the following doctype, without using the Facebox:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

So I am confused where to put the different doctypes. Can I do this ?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<head>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<script src="facefiles/jquery-1.2.2.pack.js" type="text/javascript"></script>
<link href="facefiles/facebox.css" media="screen" rel="stylesheet" type="text/css" />
<script src="facefiles/facebox.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
})
</script>

</head

Nile
08-11-2008, 04:05 PM
No, I actually thing the page is wrong. I don't know what to do about it though, try it without there document type.

boogyman
08-11-2008, 04:07 PM
the doctype needs to come before the <head>.

I believe if a second doctype is declared, the browser is put into quirks mode, but regardless, you should only have 1 doctype. deciding which doctype to use is the next step. If your page was written for XHTML than I would suggest using the XHTML doctype, however if it was written for HTML, then use the 4.01, which appears what you were using previous to this script.

boogyman
08-11-2008, 04:07 PM
No, I actually thing the page is wrong. I don't know what to do about it though, try it without there document type.

deleting the doctype all together is not the solution, its finding which one to use and where to put it.

chechu
08-11-2008, 05:19 PM
Thanks for your replies, but so the script doesn't work ?
I tried all possibilities with both, none and each doctype, and none works. Too bad, because it looks like a nice script !

Nile
08-11-2008, 05:41 PM
Can we please see a link to your page. Its very confusing without it.

chechu
08-11-2008, 06:40 PM
I placed it here: http://www.cecicasariego.com/decometvideo.html
You will see that in the bottom bar the yellow symbol comes up, saying there's an error on the page (probably because of the doctype). Then the pop-up shows, but without the video in it, and that's what this page is all about.

Nile
08-11-2008, 07:08 PM
I do not see anything wrong with this script, it works in IE and FF.

chechu
08-11-2008, 07:25 PM
Yes, the pop-up comes up, but
1/ th error symbol comes up in the statusbar, so something is wrong
2/ the video doesn't come up

Nile
08-11-2008, 07:26 PM
The video comes up for me, witch browser are you using?

chechu
08-11-2008, 07:30 PM
Windows IE 7 I guess.
Does the error symbol come up ?

Nile
08-11-2008, 07:36 PM
The error symbol comes up, but thats besides the point, take a look at this to find out what browser your using:
http://www.quirksmode.org/js/detect.html Your probably using IE, but I need to know witch version.

chechu
08-11-2008, 07:45 PM
Yes, IE 7 on Windows.

Nile
08-11-2008, 07:47 PM
Hmm, try putting it on a page of its own and seeing if it works, it may be the surroundings, because it didn't work for me either, when I right click where the movie was supposed to be it said Movie Not Loaded.

chechu
08-12-2008, 08:38 AM
I have changed the code into a new one, the DHML Windowfiles (couldn't find it back on DD, but I surely got it here). Everything works perfectly now.
Only disadvantage: when I close the popped up window, the sound still goes on if you didn't finish watching the whole video.