User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 426,125 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,767 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1980 | Replies: 3
Reply
Join Date: Aug 2006
Location: me::house
Posts: 908
Reputation: linux is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 23
linux's Avatar
linux linux is offline Offline
Posting Shark

Question [Javascript] My browser/computer doesn't like Javascript...?

  #1  
Dec 21st, 2006
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
Toshiba M1151.49 GB DDR-2 RAM1.6 GHz Centrino Duo80GB HDDWindows XP Media Center Edition
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2006
Location: Deptford, London
Posts: 963
Reputation: MattEvans has a spectacular aura about MattEvans has a spectacular aura about 
Rep Power: 5
Solved Threads: 48
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Posting Shark

Re: [Javascript] My browser/computer doesn't like Javascript...?

  #2  
Dec 21st, 2006
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.
If it only works in Internet Explorer; it doesn't work.
Reply With Quote  
Join Date: Aug 2006
Location: me::house
Posts: 908
Reputation: linux is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 23
linux's Avatar
linux linux is offline Offline
Posting Shark

Re: [Javascript] My browser/computer doesn't like Javascript...?

  #3  
Dec 23rd, 2006
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.
Toshiba M1151.49 GB DDR-2 RAM1.6 GHz Centrino Duo80GB HDDWindows XP Media Center Edition
Reply With Quote  
Join Date: Jan 2007
Posts: 9
Reputation: asmqb is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
asmqb asmqb is offline Offline
Newbie Poster

Re: [Javascript] My browser/computer doesn't like Javascript...?

  #4  
Jan 3rd, 2007
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?!!)
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 4:24 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC