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 329,843 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 3,705 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: 2640 | Replies: 5
Reply
Join Date: Apr 2005
Posts: 27
Reputation: bobr_1013 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
bobr_1013 bobr_1013 is offline Offline
Light Poster

Having trouble running javascript

  #1  
Oct 19th, 2005
Hi,

I'm having trouble running javascript. I have a Dell Dimension 300 system.

The code I have in my "htm" document is:

<td id="daycell">

<script language="javascript">
<! -- Hides from non-JavaScript browsers
document.write("Today is 12/15/2005<br>");
document.write("only 10 days until Christmas");
// stop hiding -->
</script>
</td>

I tried it with "JavaScript" or "javascript".

The PC blockers come up. After I allow it from the msg, nothing happens. Is there any software I need to add on my system?

Thanks,


Bob
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 33
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Having trouble running javascript

  #2  
Oct 19th, 2005
JavaScript run from a page loaded locally, will always give a "security warning" in Internet Explorer. Run the page from a server, or with FireFox, and you'll get no warning.

Invoking "document.write()" mid-page is tricky, in may in fact overwrite the current page. You also have no "document.close()".

I don't think you have any configuration problems, just inexperience with JavaScript.
Reply With Quote  
Join Date: Apr 2005
Posts: 27
Reputation: bobr_1013 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
bobr_1013 bobr_1013 is offline Offline
Light Poster

Re: Having trouble running javascript

  #3  
Oct 20th, 2005
Thanks,

This script is from a assignment in the book I am studying for our class. The "HTML" book discusses the subject, then has you insert the javascript commands in a designated area of the html page. The book discusses the script working without the "document.close" statement.

For testing, I'm running it from my memory stick ("F" drive). All the other assignments, including my project and case studies have worked fine without any problem.

What is "FireFox"? Is it expensive?

Thanks for your help
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 33
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Having trouble running javascript

  #4  
Oct 20th, 2005
Firefox is an alternative browser. It's free. If you're writing/testing code on your local system, then I recommend it. It has a built-in JavaScript debugger, for example. You can get it here: http://www.mozilla.org/products/firefox/
Reply With Quote  
Join Date: Apr 2005
Posts: 27
Reputation: bobr_1013 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
bobr_1013 bobr_1013 is offline Offline
Light Poster

Solution Re: Having trouble running javascript

  #5  
Oct 21st, 2005
Thanks for your help.

I downloaded Firefox, and was able to detect that the "JavaScript" errored off with thr above Comment line. I moved it above the <script> tag and it worked.

Again Thanks,
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 33
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Having trouble running javascript

  #6  
Oct 21st, 2005
Oh good. I should have caught that, but glad I could help at least indirectly.
Reply With Quote  
Reply

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

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Marketplace (Sponsored Links)
Thread Tools Display Modes

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

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