Forum Moderators: open
<!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">
As my doc type.
<script type="text/javascript">
<![CDATA[
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function MM_displayStatusMsg(msgStr) { //v1.0
status=msgStr;
document.MM_returnValue=true;
}
]]>
</script>
As my Function in the head section.
<a href='javascript:null()' OnClick="MM_openBrWindow('http://url.com/page.html','Download','TOOLBAR=0,LOCATION=0,DIRECTORIES=0,STATUS=0,MENU BAR=0,SCROLLBARS=0,RESIZEABLE=0,LEFT=140,TOP=50,WIDTH=356,HEIGHT=240')"><img src='download.gif' alt='download' align='right' id='dl' /></a> As my link to open a popup with a download on it.
When I validate it, this is now the last remaining issue I have. I originally had the onclick in the img tag, it didn't like it there either. So my question is, how do I go about opening my popup and keeping in compliance with my Doctype? I can have more than one popup per page depending on the content of my pages, this is the nicest popup function I've found that can handle multiple windows at one time. ( preview, download, etc )
there is no attribute "OnClick"
onclick
xhtml has to be lower case.
birdbrain
<script language="JavaScript type="text/javascript">
<![CDATA[function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function MM_displayStatusMsg(msgStr) { //v1.0
status=msgStr;
document.MM_returnValue=true;
}
]]>
</script>
And it breaks the script, I thought using transitional would mean I could still use popups?
Removing the CDATA makes it work again but the page nolonger validates. Is there anyway to fix this?
One other comment -- you can use javascript in strict XHTML as well as transitional, but what you can't use to open a new window is the target attribute. Same issue comes up in HTML 4.01 strict vs. transitional.