Xhtml W/javascript And Css Only Works In IE
Jul 23, 2005
There are two main things which I am trying to work through:
Drop down menu (bottom of page) - which only works in IE (on pc) right
now, although it should work on all browsers except opera.
Traditionally in a HTML 4.0 Transitional environment.
Div content that scrolls - placed correctly and works in IE and that's
it. Here is an example of the working script on another site
http://www.dyn-web.com/dhtml/scroll/scroll-rel.html . Traditionally in
a Xhml strict.
My goal is to get this page to look as good in Netscape and on the mac
as it already does in IE.
View 2 Replies
ADVERTISEMENT
Aug 6, 2004
the following line is erroring in an xhtml validator:
var ns6clock=document.getElementById && !document.all
the && is erroring, but I cant work out how to change it eg to the ascci value? Code:
View 10 Replies
View Related
Jul 11, 2002
does anyone know of any sites that use (validating) xhtml strict, and also use javascript functions - rollovers etc?
(the strict dtd won't allow you to use the "name" attribute, in images, so I want to find out what the solution is to this problem)
View 4 Replies
View Related
Jul 26, 2006
I'm considering in teaching myself some javascript, but before I take the time to read up and experiment, I had a few questions.
Is javascript XHTML 1.0 STRICT Valid?
Is javascript valid for any version of XHTML?
Is javascript easily cross browser compatiable, or will this take a long time to work around?
View 11 Replies
View Related
Jan 28, 2007
I am using a simple javascript image insertion on my XHTML page, and I have encountered a problem. The Javascript code fails to execute when the doctype is XHTML on Firefox (works on Opera). However, when I simply rename the file with an HTML extension, the code executes on all browsers. Code:
View 6 Replies
View Related
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
Nov 27, 2005
I have the following javascript function, which works fine in Firefox but does not work in IE. I have a feeling it has something to do with window.status. Any ideas??
<!-- START JAVASCRIPT -->
<script type=text/javascript>
function tracker() {
window.focus();
if (window.status) {
click = new Image();
click.src = 'http://myurl.com/tracker.php?pid=12345&type=click'
}
};
view = new Image();
view.src = 'http://myurl.com/tracker.php?pid=12345&type=view'
//-->
</script>
<!-- END JAVASCRIPT -->
<!-- START BANNER CODE -->
<a href="http://www.myurl.com/purchase.php?pid=12345" onMouseDown="tracker();"
onMouseOver="status='http://www.myurl.com/purchase.php'return true;" onMouseOut="status=''"><img
src='http://www.myurl.com/images/banners/banner.gif' alt='product' border=Ɔ'></a>
<!-- END BANNER CODE -->
View 7 Replies
View Related
Jun 29, 2006
I want to remove from string a <span> tag, but with leave the value of
that tag.
I have that code:
theExp = new RegExp("<span>", "g");
txt = txt.replace(theExp, "");
theExp1 = new RegExp("</span>", "g");
txt = txt.replace(theExp1, "");
and this works only with FF,
With IE it doesn't remove the tag.
With Opera the same
View 4 Replies
View Related
Aug 11, 2006
Usually it's the other way (IE works, Firefox not working)... but here it is. IE does render something, although it puts the advert script (starting on line 9) at the very end, after the close of the last table. Firefox displays it as I have intended it (Ad inside the table). Code:
View 1 Replies
View Related
Jul 20, 2005
function CheckImageBtn(eleName,sortfield)
{
document.forms[0].sortby.value=sortfield;
document.forms[0].txtIsHrefClick.value = 'Y'
var objElem;
objElem=eval("document.all."+eleName);
objElem.focus();
objElem.click();
return true;
}
View 1 Replies
View Related
Mar 1, 2007
I have some code, using all the DOM documentation in the developer.mozilla.org website. For some reason it's only working in the newest Firefox 2 versions, and not 1.5.0.x
I'm having a hard time finding any documentation of what's not supported.
Can you guys help me? Here are the functions I'm calling:
getRangeAt();
range.collapsed
document.createElement("div");
range.cloneContents();
element.appendChild(clone);
document.getElementById("divid");
do you think it's createElement div? Maybe I can't create a div element?
View 1 Replies
View Related
May 17, 2007
I've spent the last two hours trying every other solution listed, to
no avail: this works, so I'm sharing it for the other folks who
couldn't find a solution other than switching to another language.
var fileString = "mydevfolderfolder2folder3file.txt";
var myPat = /%5C/g; //this is using regular expression to
define the escaped version of a backslash
fileString = escape(fileString);
fileString = fileString.replace(myPat,"%5C%5C");
fileString = unescape(fileString);
fileString now equals "\mydevfolderfolder2folder3 file.txt"
View 9 Replies
View Related
Jul 23, 2005
I have a page with two frames, 'header' and 'main'. The following
code works in Netscape, but in Internet Explorer. The second bgColor
line produces an error:
function test(){
top.frames.header.document.bgColor='white' //works fine
top.frames.main.document.bgColor='white' //fails
}
View 1 Replies
View Related
Nov 30, 2005
I am trying to include and xml document inside my xhtml document. There
are a number of reasons for this including portability, multiple
interface generation, and scalability of information.
My problem is that javascript is understanding the nodes in my xml
document as html elements.
<xml>
<book>
<title>Lord of the Rings</title>
</book>
</xml>
If I parse this, the title element cannot be extracted and the page
title(in the browser) becomes "Lord of the Rings".
Is there a way to exclude this xml node from the xhtml rules?
View 6 Replies
View Related
Feb 27, 2007
Maybe you can answer a question for me: I'm reading the preview for XML web development (sitepoint book) and it clearly shows IE rendering XML (the author states IE5 and above); does that mean that IE's problem with XHTML is CDATA and not XML universally? If that's true then IE could render an albeit gimped XHTML page which would explain why HTML 4.01 and XHTML are virtually synonymous in IE 6.
Is there a workaround for this in JavaScript, if the above is true?
View 5 Replies
View Related
Dec 23, 2005
I'm facing the bug about the failure of innterHTML while
reading xhtml content inside a DIV, in fact it has passed as html
removing the closing of some nodes. Is there a way to read the content
of the div perfectly how it is in the page, kind of:
var obj = document.getElementById("myDIV");
var realContent = obj.toString();
View 22 Replies
View Related
Jul 20, 2005
IE6 in standards mode doesn't seem to hide scrollbars on the body element
(overflow:hide) Ain't this a quandary. I have it in my head that I need to
specify html instead. The scrollbars do hide on Gecko browsers though, so
there is definitely a disagreement among browser developers on how to
implement scrollbars (as a side note, Gecko browsers with their notoriously
bug-ridden resize code seem to always screw up when asked to stretch and
scroll divs, even when the page is reloaded on every resize!)
My first thought is to modify the CGI that generates the style sheet as I
already have code that deprecates the document type when hidden scroll bars
are required on IE6 (but not IE5.) This is based on the simple empirical
evidence that the scroll bars are still there on IE6 in standards mode, so
the optimal document type (XHTML strict) cannot be used. So I could just
change this to output an html style (rather than a body style) for IE6 and
lose the deprecation (it wouldn't be needed at this point.)
So the question is this. Given that CGI-based processing of browser
versions for these kinds of tweaks is taboo, what would you check on the
client side before dynamically generating the style for the body and/or html
element? It doesn't seem like you could just send both as this would surely
break some older browsers (I know you can do tricks with comments and such,
but that only works for NS4 and maybe IE3 AFAIK.)
documentElement is the only thing I can think of that indicates standards
mode and NS6/Mozilla support this AFAIK.
IE Conditional comments perhaps? I would hate to hard-code a test for a
browser version number into the actual document (for obvious reasons), but I
guess it is an alternative if the browser version is exposed to these
things.
I don't see any other way to deal with a situation like this than with
server-side code that looks at the browser's version number and makes the
necessary adjustment. And there are lots of little differences like this
that just don't seem to have viable client-only solutions. There's DirectX
stuff (probably is an object detect for that) and funky colored scrollbars
(hey people ask for them) and document margins (Opera did them slightly
differently than the rest as I recall) and now this scrollbar thing.
View 24 Replies
View Related
Aug 15, 2007
How do you get JS to validate? Am more or less positive my JS used to validate now the following won't even pass
if(1==1 && 2==2)
{
}
why? because the validator wants &&
Any ideas how even that script can be validated. The doc type is transitional.
View 4 Replies
View Related
Jul 23, 2005
When using innerHTML to insert xhtml IE5+ mangles the xhtml completely. For example it removes the quotes from attributes. It also does other ridiculous things like on a <div> it will insert the enbedded style="DISPLAY:BLOCK"! This is a documented feature you can find in msdn.
Is there a way to disable this quite appalling feature?
View 10 Replies
View Related
Aug 26, 2005
I am trying to find a way to load XHTML content in an Iframe.
I use to do this in html by using the following code :
var iframeObject = document.createElement("iframe");
MyDiv.appendChild(iframeObject);
var data =
"<html><head><title>testing</title></head><body>data</body></html>"
iframeObject.contentDocument.open();
iframeObject.contentDocument.writeln(data);
iframeObject.contentDocument.close();
This works fine. I can create my content dynamicly and synchroniously.
No problem.
No I try to switch to XHTML, but have trouble getting th eiframe to
understand that it gets XHTML data. It simply assumes that the data is
"text/html".
I tried to add the contentType with the .open() arguments:
var iframeObject = document.createElement("iframe");
MyDiv.appendChild(iframeObject);
var data = "<!DOCTYPE html PUBLIC "-//W3C//DTD ..etc..
transitional.dtd">"
+ "<html xmlns="http://www.w3.org/1999/xhtml" > etc etc </html>";
iframeObject.contentDocument.open("application/xhtml+xml", true);
iframeObject.contentDocument.writeln(data);
iframeObject.contentDocument.close();
The code runs but the content is not seen as xhtml, so I can't mix html
and xml. Someone gave me the hint to use the following:
iframeObject.src="data:application/xhtml+xml,"+data;
This works, the data gets loaded and is actually seen as xhtml, but..
the loading happens async in stead of sync.
Is there anyone who can help me with :
- does document.open("application/xhtml+xml", true) work at all?
should it work ?
View 16 Replies
View Related
Nov 25, 2006
I try the following in Firefox and other modern browsers:
window.addEventListener('load', function() {
document.title = CSS.getClass('fontSize');
var div = document.createElement('div');
document.getElementsByTagName('body')[0].appendChild(div);
alert(div);
alert(div.style)
}, true);
It works fine in normal HTML mode (Content-type: text/html), but in
XHTML mode it alerts "[object Element]" instead of "[object
HTMLDivElement]" and the second alert shows "undefined" instead of
"[object CSSStyleDeclaration]". So I can't reach the style declaration
which is important for me. Strict mode makes trouble again and again,
the biggest bug: document.write does not work:
View 10 Replies
View Related
Nov 7, 2007
I've just been converting my ASP v2.0 web site to use master pages which by
default uses this doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
whereas before it used to use:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
This appears to have effected the multi-line textarea tag in that it doesn't
completely obey the height attribute. It appears to adjust the height to the
nearest line height.
Is there anyway to get around this?
View 1 Replies
View Related
Jul 20, 2005
Opera 7 doesn't appear to support the <script> element in XHTML. Does
this mean that it impossible to use Javascript with XHTML? Or is there
a workaround, such as the legacy method, in HTML, of commenting out the
Javascript code.
View 1 Replies
View Related
Mar 21, 2010
Can JQuery deal with XHTML DOM?I was told that it cannot and that I should use only HTML Strict.
View 2 Replies
View Related
Apr 24, 2007
An easy XHTML1.1 valid way of aligning divsfunction XHTMLAlign(tagid, align){
var viewportwidth;
var viewportheight;
// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
if (typeof window.innerWidth != 'undefined')
{
viewportwidth = window.innerWidth,
viewportheight = window.innerHeight
}
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
else if (typeof document.documentElement != 'undefined'
&& typeof document.documentElement.clientWidth !=
'undefined' && document.documentElement.clientWidth != 0)
{
viewportwidth = document.documentElement.clientWidth,
viewportheight = document.documentElement.clientHeight
}
// older versions of IE
else
{
viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
viewportheight = document.getElementsByTagName('body')[0].clientHeight
}
var tag = document.getElementById(tagid);
tag.style.position="absolute";
if(tag.style.marginLeft == ""){
tag.style.marginLeft = "0";
}
if(tag.style.marginRight == ""){
tag.style.marginRight = "0";
}
if(tag.style.marginTop == ""){
tag.style.marginTop = "0";
}
if(tag.style.marginBottom == ""){
tag.style.marginBottom = "0";
}
if(tag.style.width == ""){
if (tag.width != ""){
tag.style.width = tag.width;
} else {
tag.style.width = "0";
}
}
if(tag.style.height == ""){
if (tag.height != ""){
tag.style.height = tag.height;
} else {
tag.style.height = "0";
}
}
if ( align=="left" ){
tag.style.left=parseInt(tag.style.marginLeft) + "px";
tag.style.right= viewportwidth - (parseInt(tag.style.width) + parseInt(tag.style.marginLeft)) + "px";
} else if ( align=="right" ){
tag.style.right=parseInt(tag.style.marginLeft) + "px";
tag.style.left=viewportwidth - (parseInt(tag.style.width) + parseInt(tag.style.marginRight)) + "px";
} else if ( align=="center" ){
tag.style.right= ((viewportwidth - parseInt(tag.style.width))/2) - parseInt(tag.style.marginLeft) + parseInt(tag.style.marginRight) + "px";
tag.style.left= ((viewportwidth - parseInt(tag.style.width))/2) + parseInt(tag.style.marginLeft) - parseInt(tag.style.marginRight) + "px";
}
if ( align=="top" ){
tag.style.top=parseInt(tag.style.marginTop) + "px";
tag.style.bottom= viewportheight - (parseInt(tag.style.bottom) + parseInt(tag.style.marginTop)) + "px";
} else if ( align=="bottom" ){
tag.style.bottom=parseInt(tag.style.marginTop) + "px";
tag.style.top=viewportheight - (parseInt(tag.style.width) + parseInt(tag.style.marginBottom)) + "px";
} else if ( align=="vcenter" ){
tag.style.bottom= ((viewportheight - parseInt(tag.style.width))/2) - parseInt(tag.style.marginTop) + parseInt(tag.style.marginBottom) + "px";
tag.style.top= ((viewportheight - parseInt(tag.style.width))/2) + parseInt(tag.style.marginTop) - parseInt(tag.style.marginBottom) + "px";
}
return;
}
setInterval('XHTMLAlign("divid", "center")', 100);
setInterval('XHTMLAlign("divid", "vcenter")', 100);
View 2 Replies
View Related
May 10, 2006
How can I make an XHTML-compliant form of an expression in this
format:
document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>");
this turns out to be a non-trivial exercise. inserting '<' and
'>' causes the browser to write the text to the page as literal
text rather than as the intended script element. Using escape codes
seemed to work (makes it standard compliant) but the text is not
written to the page.
The point is to have a conditional branch in which, when a certain
condition is true, a script tag will be generated that will call a
JS include that responds to the specific condition.
This procedure works in the present implementation -- but fails XHTML
compliance testing. Now, we would like to have both.
View 11 Replies
View Related