The computer I am currently on:
Windows XP SP2
Internet Explorer 7
That's all you really need to know.

I use Javascript a lot, but recently, I have traveled over into the more application programming, and less web programming. I opened my father's laptop, and typed in a pretty *long* Javascript. I saved as javescript.html and tryed to open it in IE7. It has the thing at the top saying "Script wasn't opened" so I clicked "Run script" and it disappeared, but all the page had on it was nothing. I tried it in a bunch of ways, all with no luck. So, I went over to W3SCHOOLS and copied one of their codes:

<html>
<body>
<script type="text/javascript">
//If the time is less than 10,
//you will get a "Good morning" greeting.
//Otherwise you will get a "Good day" greeting.var d = new Date()
var time = d.getHours()
if (time < 10) 
{
document.write("Good morning!")
}
else
{
document.write("Good day!")
}
</script> 
 
</body>
</html>

I tried to run it, still, a blank page. Then, I tried this script (way more basic):

<html>
<body>
<script type="text/javascript">
<!--
document.write("Testing...")
//-->
</script>
</body>
</html>

Still, a blank page. Is there some error that I am just NOT seeing, or is it IE7? I have no idea if it's IE, because my dad doesn't want Firefox on this computer. Once I get my Linux box back, I'll try it on that.

Any help would be appreciated! I want to get back to Javascript!
-- Alex

Recommended Answers

All 3 Replies

hm... i haven't used IE7 very much, and I don't use it home or I'd check that out... but, try something even more simple:

<html>
<body onload="alert('Javascript is functioning correctly');">
</body>
</html>

if that doesn't work, then JS may be disabled... there is an option to disable it, but I'm pretty sure the default is enabled... Have a look in all the options dialogs for reference to 'letting pages run scripts'

there's always a more 'strict' environment on local pages/scripts than on pages that are on a webserver. i guess that's because web scripts have request access to their immediate locality.. and you wouldn't want to download a script that had request access to your filesystem... so, if all else fails, try uploading the script somewhere to test it.

It's gotta be IE7, because I tried the same script on my Linux box using Firefox, Epiphany, and Opera, and they all worked.

I have to check into that.

Also, in IE7, when moving checkboxes around on the page, they always change back to their original state (checked, unchecked). I find this frustrating.

I grabbed IE7 as soon as it came out, so I am fairly proficient at it. I'm typing this post with it.

Try this.

>> Open Internet Options. To do so, either click Tools > Internet options from the menu bar (if the menu bar is not visible, press ALT to make it visible) or click the little gear icon near the right (on the same bar that the tabs reside) and select Internet Options from it. Either way, I O will be the bottom-most option.

>> Select Security.

>> Select Custom Level... (the button).

>> In ActiveX controls and plug-ins, run down to "Automatic prompting for ActiveX controls" and select "Enable".

>> In "Scripting", select "Enable" for "Active scripting" (the option is just underneath the header).

>> Hit OK.

>> Select Advanced.

>> Go down to Security.

>> Enable both "Allow active content from CDs to run from My Computer*" (as a convenience) and "Allow active content to run in files on My Computer*" (this is the big one).

>> You would have noticed the stars next to those options, meaning that for them to take effect you have to restart IE (not the whole PC!). Close down all instances of IE, and re-open.

>> Test the script...

>> ... and then post how well it works. (Don't post that it didn't work, okay?!!)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.