Without DOCTYPE It Works, With It Does Not?

Aug 17, 2010

I have a javascript (snow.js) on my website. Without a DOCTYPE in my HTML it runs in IE, Mozilla and Chrome.Because my mouse-overs (hover) were not working in Chrome I needed to add a DOCTYPE, after it worked (DOCTYPE : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:[url].....).

But my javascipt still works in IE but not in Mozilla and Chrome anymore. This script runs with the following statements after <body> :

<script language="JavaScript" src="snow.js">
</script>

View 6 Replies


ADVERTISEMENT

Lightbox That Works Without A DOCTYPE?

Apr 5, 2010

For a variety of reasons that I won't currently go into, I need a lightbox script that doesn't rely so heavy on the document's DOCTYPE (Strict, Transitional, etc) and will just work with a page where the DOCTYPE doesn't get assigned.

View 5 Replies View Related

Which Is The Best DOCTYPE To Use ?

Jan 5, 2011

which is the best DOCTYPE to use with JavaScript?Just validating now and its telling me that the<body onLoad="startclock()"> onLoad attribute is not supported....

View 6 Replies View Related

Doctype Killing JS In IE?

Dec 9, 2011

I was roughing out a feature I want to add to my site in notepad with no doctype declare.I got it just how I wanted, then realized it didn't work in IE. I added a doctype, it validates at xhtml strict, but it killed IE, while it started adding round corners in IE which wasn't working with no doctype...but now my JS isn't working... So I lost functionality of the JS while adding the round corner style that wasnt working when the JS was mostly working...FF works fine every damn way of course....I uploaded it to http://[url]......Also when it was functioning, the lower set of icons background wasn't showing. You can load that link ^^ in FF to see exactly what I'm going for....it works in ff

css:
body {
margin: 0px;[code]....

View 8 Replies View Related

DOCTYPE Causes Form To Fail?

Aug 2, 2011

I had to add the following DOCTYPE to a webpage in order for IE to parse my page design properly, and this caused the form on the page to fail in FireFox (which works fine without the doctype). The form works fine in IE.Here is the DOCTYPE I added to the top of the page;

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

The error log in FireFox says;

frmTest is not defined - Line 30

Here is the block of code it is referring to;

function MoveForward(ipage)[code].........

View 4 Replies View Related

Doctype Stops This Js From Functioning In Ie?

Sep 25, 2011

This <div> layer positioned always at bottom left of the screen on scrolling (and calling some code from labpixies) works well in non-ie browsers, but in ie it requires the omission of the doctype declaration. Why? Is it possible to fix it so that it works with the doctype in ie?

<!doctype html>
<html lang="en">
<head>
<title></title>
</head>

[Code]...

View 8 Replies View Related

Doctype Declaration Must Be On The Very First Line?

Oct 19, 2010

is it true that the doctype declaration must be on the very first line (there mustn't even be a blank line above it) in order for it to be "working correctly" ?

View 8 Replies View Related

The Doctype Destroys My Javascript

Jan 11, 2005

I use the following script for a scrolling button, it scrolls down with you if you scroll down.

Only one problem, it only works if I don't use any doctype.
If I do, the script stops working.

But without a doctype my CSS is rendered different, so that's not what I want ofcourse.

Somebody got an idea on this one? Code:

View 3 Replies View Related

Firefox, Doctype And Javascript

May 9, 2005

I have a section of Javascript code that works a treat in IE but does nothing in Firefox. If we remove the doctype it appears to work, put the doctype back in and it breaks. We need the doctype to remain in so the page renders correctly cross-browser. Code:

View 2 Replies View Related

DOCTYPE :: Display A Map With Google Maps?

Aug 27, 2009

I am trying to display a map with Google maps. The code listed below is located at http:[url]....

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">[code]....

I find another example where some uses a CDATA tag, but it still doesn't work. http:[url]...I finally remove the DOCTYPE and it works. http:[url]....My problem is I want the DOCTYPE.

View 4 Replies View Related

DOCTYPE :: Customers Does Not Declare A .dtd Document?

Jul 22, 2009

I have a problem with customer website.My script creates an Auto-Greet that overlays the page, displays in the lower left of the browser and remains visible as the user scrolls the page.

My Mockup the customer home page. This is the desired action.http:[url]....Customer website: (undesired action)http:[url]....The only difference is that my customers does not declare a .dtd document.They have a <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">. On my mock-up, I declare a .dtd document and my script works.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http:[url]...

Question: I'm trying to figure out a way in javacript to dynamically change the <!DOCTYPE, is this possible?

View 1 Replies View Related

Xhtml Doctype And Form Name Attribute?

Aug 21, 2010

I have been attempting to transition to use of xhtml strict doctype andmy text editor, BBEdit (on Mac) tells me, when I ask it to check syntax,that the attribute 'name' is not allowed in form object, as in any otherform element that I tried to use it in. This begs the question, how doI script forms with javascript in the context of this doctype? None ofthe javascript texts I have address this issue (O'Reilly Rhino book andothers).I could figure it out, but it appears to be a complicated process, justdoing getElementById() and sorting it out.Does anyone have a reference to material that deals with this issue?

View 2 Replies View Related

GetDOCTYPE() Function - Get Various Properties Of DOCTYPE

Jun 10, 2009

Without getting into too much history on the why, I came into a situation where I needed to create a function to get various properties of !DOCTYPE so that other functions could adjust to work properly with certain DOCTYPEs (Strict, Transitional, etc.). I have tested the function in the following Windows browsers IE6+ FF3+ Chrome2+ and Safari3+ Opera9+. The only one that I can’t get working is Opera (testing with 9.64). I’m hoping that someone out that has a solution! Here is the code:

[Code]...

View 3 Replies View Related

Floating Menu Doctype Problem

Apr 18, 2006

I am trying to implement a floating menu with a strict doctype for HTML 4.01.

I have got it working without the doctype but as soon as I insert the doctype line it just falls flat on it's face, anyone know of a working floating menu for this situation?

View 2 Replies View Related

Update JS To Work With A Strict DOCTYPE

Nov 16, 2006

I am now using a strict !DOCTYPE and want to ensure that my pages comply. The Javascript I used to use no longer works - how can I seperate it from the structure of the page?

<input name="rdo1" id="rdo12" type="radio" checked="checked" value="didnt"

<textarea name="txtarea1" id="txtarea1" cols="20" rows="5">

<script type="text/javascript">

/*
Clear default form value
*/

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}
</script>

View 3 Replies View Related

Loaded XML File Failing Due To Doctype Tag

Aug 30, 2011

I have an XML file that I'm trying to load into and xml object, however the doctype tag is killing the javascript, and does not parse the XML at all. If I remove the doctype, the javascript can parse, and I can access the XML DOM. So I know the XML is valid. Even with the Doctype, it validates. However Javascript does not like it. I don't have a choice to remove the Doctype tag of the XML.

If I remove the Doctype, this method works to parse the XML DOM:
Code:
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.load(filename);

Also, if I use the .open method to retrieve the XML, I cannot access the XML DOM via xmlhttp.responseXML. But I do get a result when I use xmlhttp.responseText, it displays the corresponding XML.
Code:
xmlhttp.open("GET", filename, false);

View 1 Replies View Related

Adding Doctype Removes Table?

Dec 15, 2010

I have a simple page that uses ajax, php, mysql to get database entries and displays them in a table by a limited number of results.

ie. it only shows 10 entries at a time.

Anyways, as soon as I had ANY DOCTYPE to the document, the table no longer shows up in Firefox. It will how ever show up in IE8 or if I remove the DOCTYPE.

Page WITH DOCTYPE
Page WITHOUT DOCTYPE

What on earth would be causing this? I have validated the page with W3C with VALID markup.

View 2 Replies View Related

Move An Image - Not Working With XHTML Doctype ?

Jan 12, 2010

I'm trying to move an image with the following JS function, but it only seems to work when I remove the XHTML doctype from the top of the document.

Here's the javascript:

Code:

I read something about this on another forum and I think it has something to do with the declaration of obj.style.top, but I can't find a solution. I've tried creating a new variable that contains "document.getElementByID(obj)" and then using that variable to change the top of the image, but it still doesn't work.

View 12 Replies View Related

Added DOCTYPE To The Top Of Document, Now It Won't Change The Width?

Dec 19, 2010

So I didn't know whether to put this in HTML & CSS or here. So I'm just going to put it here and the mods can move it if needed.So I had this script working for auto width of a DIV, then I added DOCTYPE to the top of my document, now it won't change the width ha ha. I have tried with all DOCTYPE's and same thing.The JS I am using is:

window.onload=function(){
document.getElementById("right").style.width= + screen.width - 193;
}

As I said this worked before I added DOCTYPE to the top of the HTML. But when I add any one of the DOCTYPES it stops working.

View 4 Replies View Related

TinyCarousel :: The DOCTYPE It Still Worked Fine In All Browsers Except IE7?

Jul 29, 2011

i have an html page with no DOCTYPE and this image carousel works fine across all browers.i tried to add a DOCTYPE (tried, xhtml, xhtml, html5) and all their various to narrow down what it doesnt like to no avail.after adding the DOCTYPE it still worked fine in all browsers except IE7. its like it ignored hiding the overflow.. all of the images we just displayed inline across the page.

View 2 Replies View Related

Firefox: Correct Xhtml DOCTYPE Tag Breaks Script?

Aug 2, 2006

I have created an animated image gallery in dhtml. It works fine in
Internet Explorer. In Firefox, it only works if I ommit the DOCTYPE tag.
The page is valid xhtml-strict but with a xhtml1-strict DOCTYPE, I get a
dead script and dozens of error messages like "Error in parsing value in
property 'width'. Declaration dropped." on Line 0. Code:

View 15 Replies View Related

Changing Doctype From Strict To Transitional Stops Script?

Oct 12, 2010

1- I have a Tabs list (Services/Solutions/Internal...) in below website which has been done using Javascript.

[URL]

Now if I change the Doctype from Strict to Transitional the javascript ceases to work correctly (and I was not able to find why).

See here:

[URL]

2- I need the Transitional doctype because my language menu does not work with Strict!!! and I guess fixing the Javascript might be easier than that.

What is the problem? What should I do to avoid such problems? (I guess I prefer strict type XML documents).

View 3 Replies View Related

Doctype W/ No Script - Stop Reflective Xss Attacks For Parts Of A Certain Page?

Jul 29, 2010

Is there anyway to create a page w/ doctype or headers that tell the browser something like "there's JavaScript in this page and you have JavaScript turned on, but don't execute it because the developer was too lazy to validate the data".I'm looking to stop reflective xss attacks for parts of a certain page. There's always going to be that one user who throws a lot of junk into the form and eventually some combination of bad code will get through.

View 4 Replies View Related

JavaScript Popup On Window Close: Works Great On IE, Works Terribly On FF

Dec 13, 2006

I'm just restating my "site abandonment" post but with a clearer title as I realized it probably only made sense to me and me alone.

I have window that pops up with our commerce system. I have it set to pop up a window via JavaScript if the visitor quits early in the process (abandons the commerce system before completing all of the steps. The new popup is just a customer survey ("why are you leaving, is there something else we can help you with" etc. etc.).

Here's the problem, it works fine in IE, but in Firefox, anytime the page in the original commerce window is changed, refreshed or advanced to a new page, the survey popup window is called rather than just on window close.

Again, here's the two JavaScript routines that handle clicks on the graphical close button and on the window 'X' close button. Code:

View 9 Replies View Related

Getting JS That Works In FF?

Mar 24, 2011

So I have this code listed below:

<script type="text/javascript">
if (!window.console) {
window.console = {

[code]...

It works perfectly fine in IE but as soon as I load it in FF it does nothing.

View 1 Replies View Related

IE Works Once (more Or Less) But Not Again

Nov 26, 2010

I have a page at the following url:[URL]Pick a continent, select a country ( orange if in Asia, green if in Africa) click on one of the bullets and some info pops up. Works fine in FF and Safari but in IE, it works (almost) once, but then goes dead i.e. the links seem to disappear. get this working in all browsers?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved