Forum Moderators: open

Message Too Old, No Replies

New to Javascript.

         

sren

2:36 am on Aug 23, 2005 (gmt 0)

10+ Year Member



I'm currently working with a HTML template which I like.
Inserting javascript code wasn't part of my plan, but this template has a nice special place for displaying the date and year.
So I did it and it look nice. But my main concern is XP-SP2 firewall warning me about the 'unknown' script.
Of course I don't care about that warning, but what would happen with the people when they reach my website?
Is there a way to insert a date avoiding the almighty SP2 to bother?

And another question.
Would Javascript code cause problems to SE spiders?

Thanks everyone.

JAB Creations

1:05 pm on Aug 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



XP SP2 is lame and very unstable on all computers I've ever been suckered in to installing it on to. My advice is to stick with SP1.

Regardless SP2 will complain about scripts all the time because MS was too lazy to actually program SP2 to recognize the difference between YOU deciding to run a script intentionally and Windows itself trying to automate a script.

With anti-spyware by MS you can have it remember what scripts you don't want to keep getting harrased about, but this is a pain if you work with Javascript.

My adivce is to uninstall SP2 if you value your sanity.

encyclo

1:15 pm on Aug 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My advice to to keep SP2 if you value your security. ;) You have to bear in mind that a majority of XP users are now running SP2, so you must cater for the security changes in SP2 rather than sticking your head in the sand. The stability problems of SP2 are mostly a myth - the problems mostly occur when installing SP2 on a machine which has had spyware infections. But all that's off-topic anyway. :)

Back to your questions, a simple date/time script should not be triggering any warnings. How are you including the script? Is it inline within the HTML document or as a separate file?

For your second question, search engine spiders will ignore the script - it won't cause any problems.

Leosghost

1:32 pm on Aug 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Most people already have date and time in their taskbar tray ..avoid uneeded code on the page ...

SP2 ..like what Encyclo said ( altho I still think it's a lash up ) is way safer than SP1..

sren

5:39 pm on Aug 23, 2005 (gmt 0)

10+ Year Member



Thanks a lot guys, I'll paste the code I found in a book.
I just adapted the


<script language="JavaScript1.2">
<!-- Begin
var months=new Array(13);
months[1]="Enero";
months[2]="Febrero";
months[3]="Marzo";
months[4]="Abril";
months[5]="Mayo";
months[6]="Junio";
months[7]="Julio";
months[8]="Agosto";
months[9]="Septiembre";
months[10]="Octubre";
months[11]="Noviembre";
months[12]="Diciembre";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year < 2000) // Y2K Fix, Isaac Powell
year = year + 1900; // [onyx.idbsu.edu...]
document.write(date + " de " + " ");
document.write(lmonth + " del " + year);
// End -->
</script>

I just adapted the document write and the variables to display it in spanish.
Let me know if this one is out dated and is the cause of the SP2 to complain.

Thanks again.

OlRedEye

4:06 am on Sep 25, 2005 (gmt 0)

10+ Year Member



Back to your questions, a simple date/time script should not be triggering any warnings. How are you including the script? Is it inline within the HTML document or as a separate file?

I have tried to steer clear of javascript for a variety of reasons, not least of which is that I know little about it, already so many issues and angles to keep up with...

I now want to include a few simple scripts to bookmark, mail a friend etc, nothing serious. However, my first concern is stability for my users - conversion.

Any warning messages about ssl certificates, javascript etc is a big no-no in ecommerce, so this sp2 issue worries me.

What would the difference be re sp2 in including js inline or as a seperate file?

Advice much appreciated.

OlRedEye

4:24 am on Sep 25, 2005 (gmt 0)

10+ Year Member



After searching all morning for further info, but only after posting the above query, I eventually came accross this:

But when I preview my page in Dreamweaver, IE alerts me that content is blocked!

This is correct. Microsoft created a Lockdown Zone to block all Active Content on pages that reside on your local hard drive. JavaScript and Flash will be blocked when you preview a local file - but the page will display normally when viewed on the internet. Microsoft did this to protect the lowest common denominator of users from malevolent content delivered via traded CDs, DVDs, and other portable media - or from files saved via the internet or e-mail to your local hard drive.

According to this there is no real problem with SP2 as far as visitors are concerned(?)

Enabling the preview of Active Content in Dreamweaver

To enable viewing active content in files that are on your local hard drive:
In IE, Choose Internet Options - Advanced
Scroll down to the Security Heading
Check the option labeled: Allow active content to run in files on my computer. You can also check the box above this if you want to allow active content to run from CDs.
Restart Internet Explorer for the changes to take effect

Which means I can start asking stupid questions here about mail-a-friend scripts? :)

rocknbil

10:48 pm on Sep 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



sren - I believe this is an issue that has been long known, does the script get blocked if you upload it to a server? Probably not. This is an issue only with locally executed files (annoying nonetheless.) If you're already aware of that, sorry, but I see it mentioned nowhere here.

So the answers are if you upload the page and it doesn't block, no, you don't have a problem. Javascript is (generally) ignored by SE's so using it shouldn't be a problem - just don't bury any vital links in Javascript (such as drop-down menus, etc.)