1.

Solve : Javascript treated as text - Don't know why?

Answer»

This happens in IE 11, Firefox 26.5, and SAFARI. Neither BROWSER recognizes my javascript other then the Alert command.

Here's the code that works:


"HTTP://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">



Untitled Document








The Alert box comes up properly.

=========================================

When I run the FOLLOWING code;

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


Displaying Times and DATES





Current Date and Time



alert("alert-aliens attacking");
document.write("alert-aliens attacking");

Now1 = New Date();
localtime1 = now1.Tostring();
utctime1 = now1.toGMTString();
document.write("Local Time: '
+ Localtime1 + '
");
document.write("UTC Time: " + utctime1);






"Only the H1 displays. Nothing else works. Not even the Alert.  Am I missing something?

Any assistance would be greatly appreciated.

Barry



Discussion

No Comment Found