473,785 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript dies on IIS server

The script below loads a calendar page in an iframe and scrolls to
today's date.

It works just dandy on my apache/linux server, but won't do anything
when I use IIS. (Nothing appears on the page at all where the script is
at.)

I'd appreciate any suggestions on how to make this work from the IIS
server.

Thanks, in advance!

-Cloy
<script language="JavaS cript" type="text/JavaScript">
<!--
var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;

document.write
("<iframe name=\"Calendar \" width=\"215\" marginwidth=\"0 \"
height=\"500\"
marginheight=\" 0\" align=\"top\" scrolling=\"aut o\" hspace=\"0\"
vspace=\"0\"
src=\"calendar. htm#" +
month + day + year
+ "\"");
//-->
</script>

Sep 29 '06 #1
5 1754
Errrrrrrr... first off language="JavaS cript" needs to go. That's not
even JavaScript anymore...

Secondly, document.write dies MANY years ago. I would highly suggest
you learn DOM programming.

Third, check the content type IIS is sending the thing as. It may be
sending it as something stupid.

Cloy wrote:
The script below loads a calendar page in an iframe and scrolls to
today's date.

It works just dandy on my apache/linux server, but won't do anything
when I use IIS. (Nothing appears on the page at all where the script is
at.)

I'd appreciate any suggestions on how to make this work from the IIS
server.

Thanks, in advance!

-Cloy
<script language="JavaS cript" type="text/JavaScript">
<!--
var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;

document.write
("<iframe name=\"Calendar \" width=\"215\" marginwidth=\"0 \"
height=\"500\"
marginheight=\" 0\" align=\"top\" scrolling=\"aut o\" hspace=\"0\"
vspace=\"0\"
src=\"calendar. htm#" +
month + day + year
+ "\"");
//-->
</script>
Sep 29 '06 #2
"Cloy" <cl**@tobola.co mwrote in news:1159493073 .870492.10680
@i3g2000cwc.goo glegroups.com:
<script language="JavaS cript" type="text/JavaScript">
<!--
var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;

document.write
("<iframe name=\"Calendar \" width=\"215\" marginwidth=\"0 \"
height=\"500\"
marginheight=\" 0\" align=\"top\" scrolling=\"aut o\" hspace=\"0\"
vspace=\"0\"
src=\"calendar. htm#" +
month + day + year
+ "\"");
//-->
</script>
I would start by rewriting the iframe to avoid using \" everywhere. Use
' on the outside and " inside it (or vice versa).

Sep 29 '06 #3
ag******@gmail. com said the following on 9/28/2006 11:00 PM:
Errrrrrrr... first off language="JavaS cript" needs to go. That's not
even JavaScript anymore...
It never was Javascript to start with. It is an HTML attribute.
Secondly, document.write dies MANY years ago. I would highly suggest
you learn DOM programming.
That's idiotic. Sure, there are other ways to do it, but sometimes
document.write is just the simplest way.
Third, check the content type IIS is sending the thing as. It may be
sending it as something stupid.
And you think IE pays attention to content type? It tries to render
anything and everything.

Fourth, and most importantly, make sure you don't have a path/filename
collision.

Fifth, ignore idiotic top-posters.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 29 '06 #4
ag******@gmail. com wrote:
Errrrrrrr... first off language="JavaS cript" needs to go. That's not
even JavaScript anymore...
Please don't top-post, reply below trimmed quotes.

The language attribute never was part of JavaScript, it was introduced
as a deprecated attribute in HTML 4.

Secondly, document.write dies MANY years ago.
I doubt that you can find a visual UA with script support that doesn't
support it.

I would highly suggest you learn DOM programming.
Considering document.write( ) is a method of the document object, it
*is* "DOM programming".

Third, check the content type IIS is sending the thing as. It may be
sending it as something stupid.
I suppose you are referring to the possibility that the document is
being served as XHTML. In that case, document.write won't work - but
there is nothing to indicate that is the case.

Cloy wrote:
The script below loads a calendar page in an iframe and scrolls to
today's date.

It works just dandy on my apache/linux server, but won't do anything
when I use IIS. (Nothing appears on the page at all where the script is
at.)

I'd appreciate any suggestions on how to make this work from the IIS
server.

Thanks, in advance!

-Cloy
<script language="JavaS cript" type="text/JavaScript">
<!--
Do not use HTML comments inside script elements, they are unnecessary.

var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
Better to use getFullYear() unless very old browser support is
required. Have you considered an "add leading zero" function?

function addZ(num){ return (num<10)? '0'+num : num;}

document.write
("<iframe name=\"Calendar \" width=\"215\" marginwidth=\"0 \"
height=\"500\"
marginheight=\" 0\" align=\"top\" scrolling=\"aut o\" hspace=\"0\"
vspace=\"0\"
src=\"calendar. htm#" +
month + day + year
That seems an inappropriate choice of date format, why not use an ISO
format? Say yyyymmdd? Using addZ(), you can generate the date string
as:

var d = new Date();

document.write(
'<iframe ...
+ ' src="calendar.h tm#' + d.getFullYear()
+ addZ(d.getMonth ()+1) + addZ(d.getDate( )+1)"'
);
+ "\"");
You don't seem to have properly closed the element, where is the
'></iframe>' string?
//-->
</script>

--
Rob

Sep 29 '06 #5
Hi,

Please look in the browser's source view, to see if the javascript has made
it to the client. If it has, then this has nothing to do with IIS. IIS just
sends the HTML, CSS, javascript etc to the client. It is up to the client to
parse/intepret the HTML, CSS, javascript etc

Cheers
Ken
"Cloy" <cl**@tobola.co mwrote in message
news:11******** *************@i 3g2000cwc.googl egroups.com...
The script below loads a calendar page in an iframe and scrolls to
today's date.

It works just dandy on my apache/linux server, but won't do anything
when I use IIS. (Nothing appears on the page at all where the script is
at.)

I'd appreciate any suggestions on how to make this work from the IIS
server.

Thanks, in advance!

-Cloy
<script language="JavaS cript" type="text/JavaScript">
<!--
var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;

document.write
("<iframe name=\"Calendar \" width=\"215\" marginwidth=\"0 \"
height=\"500\"
marginheight=\" 0\" align=\"top\" scrolling=\"aut o\" hspace=\"0\"
vspace=\"0\"
src=\"calendar. htm#" +
month + day + year
+ "\"");
//-->
</script>

Sep 30 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1942
by: Ken | last post by:
How do I send a variable, $validity from php and use it in JavaScript? Seem like PHP is written first, then html and JavaScript. Is it possible? Ken
2
1625
by: leegold2 | last post by:
Can anyone recommend links that explain esp. show examples of how to use PHP and javascipt in the same page? Thanks. Lee G.
111
14431
by: Retlak | last post by:
The recommended (on dozens of websites) and effective (works in Netscape, MSIE, Mozilla, probably others) way to detect if a browser has Javascript turned off is to put this in the <head>: <noscript> <meta http-equiv="refresh" content="1;url=http://yourURL/nojscript.html"> </noscript> This redirects to a doc which typically says "You need to enable
10
1663
by: lkrubner | last post by:
I killed last night and a good chunk of today trying to figure out this one particular attempt to get a class and initialize it. My code is using a class method called getObject to include() a file and then initialize the class in that file (one class per file, each file has the same name as the class). This code has been working fine for 8 months, and now is dying on this one line. Oddly, it is dying on the last return of this method. ...
14
5486
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net that works well as an html page. It brings up a modal popup window that I have been trying to work out for days now and this was the closest I have been able to come. I added a little asp.net code and an asp.net button and cannot get it to
3
2119
by: Kirk | last post by:
Let me start by saying that I am a complete idiot when it comes to JS. However, I need help with something that apparently can only be done this way. I am using an ASP.NET AJAX control (ValidatorCallout) that requires client-side validation to work with a custom validator I added. This is an example of some code that works: <asp:CustomValidator ID="CV_PartNumberExists" runat="server" OnServerValidate="PrimeNumberCheck"
5
1840
Plater
by: Plater | last post by:
So after my previous troubles I now have asynchonous xmlHTTPRequests going. I send a request on an interval set for 5seconds. First the FF trouble: Sometimes when I refresh the page, I'll get an error saying "returnObjById is not defined". Now, returnObjById() is my own function that exists and after about 3 of these errors it decides that the function exists and uses it just fine. It seems to be related to the onreadystatechange of the...
3
5492
by: jehugaleahsa | last post by:
Hello: I have had a program that checks LDAP to get a list of all the users whose password will expire. I send these users an email letting them know to change their passwords. It had been working fine for months. Then, all of a sudden, something changed and now the service dies unexpectedly. I wrote some code to log what was the last step performed and it appears as though the service dies while it is "sleeping".
15
3255
by: Lawrence Krubner | last post by:
Does anything about this script look expensive, in terms of resources or execution time? This script dies after processing about 20 or 25 numbers, yet it leaves no errors in the error logs. This is on a server that handles a fairly demanding site. The defaults, in php.ini, have all been cranked fairly high: scripts get 180 seconds to run, and they can have as much as 256 megs of RAM. The input for this script is coming from a textarea in...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.