Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Re: javascript not running in netscape


Message #1 by "Michael Goldman" <mg188@h...> on Sat, 25 Nov 2000 14:01:07 -0800
the problem went away when I renamed the javascript test file to remove a

space.  I guess Netscape doesn't like spaces in filenames.  Sorry if I

wasted your time.



happy trails



(Not a waste of time, still useful to know! moderator)



Message #2 by "Michael Goldman" <mg188@h...> on Sat, 25 Nov 2000 12:50:46 -0800
hi,

Could someone help me figure this out.  My javascripts don't run in Netscape

Communicator 4.73.  I get this error when I try them in Netscape:



"HTTP Error 400



400 Bad Request



Due to malformed syntax, the request could not be understood by the server.

The client should not repeat the request without modifications."



This happens whether I put the javascript in an .htm page or a .asp page.



The javascripts work fine in Microsoft Internet Explorer 5.0.  I'm running

Microsoft Personal Web Server (PWS) under WIN98.



I'm working from the book JavaScript for the World Wide Web, 3rd ed.  Here's

my first script:



<HTML>

<HEAD>



<TITLE>My first script</TITLE>



</HEAD>

<BODY BGCOLOR=WHITE>

<H1><SCRIPT LANGUAGE=JAVASCRIPT

   TYPE="TEXT/JAVASCRIPT">

 <!-- Hide script from older browsers



 document.write("Hello, world!")



 // End hiding script from older browsers -->

</SCRIPT></H1>

</BODY>

</HTML>





thanks in advance







Message #3 by "Ken Schaefer" <ken@a...> on Mon, 27 Nov 2000 13:00:21 +1100
Spaces are not allowed in URLs.

You can see this in the following URL:



http://www.myserver.com/somedir/some page.asp



(see how the underlining stops at the first space?)



Instead you need to replace them with the %xx hexadecimal equivalent, which

is %20

Internet Explorer does this for you behind your back when you make an

invalid request. Netscape does not.



There are a whole raft of characters that need to be encoded in this way.

There is an ASP function: Server.URLEncode() which does it for you. I sugges

you read up on this function.



Cheers

Ken



----- Original Message -----

From: "Michael Goldman" <mg188@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Sunday, November 26, 2000 9:01 AM

Subject: [asp_databases] Re: javascript not running in netscape





> the problem went away when I renamed the javascript test file to remove a

> space.  I guess Netscape doesn't like spaces in filenames.  Sorry if I

> wasted your time.

>

> happy trails

>

> (Not a waste of time, still useful to know! moderator)





Message #4 by Van Tolhuyzen Koen <Koen.VanTolhuyzen@c...> on Mon, 27 Nov 2000 09:43:23 +0100
 Michael,



Did you try it by replacing the space in the code by   ?

Just curious if that would do the trick too



Koen





-----Original Message-----

From: Michael Goldman

To: ASP Databases

Sent: 25/11/00 23:01

Subject: [asp_databases] Re: javascript not running in netscape



the problem went away when I renamed the javascript test file to remove

a

space.  I guess Netscape doesn't like spaces in filenames.  Sorry if I

wasted your time.



happy trails



(Not a waste of time, still useful to know! moderator)





Message #5 by "Eric Van Camp" <eric.vancamp@c...> on Mon, 27 Nov 2000 12:55:29 -0000
correct, but as others told me, use server.urlEncode() for this to give

strings. The server will rework the string correctly!



-----Original Message-----

From: Van Tolhuyzen Koen [mailto:Koen.VanTolhuyzen@c...]

Sent: Monday, November 27, 2000 8:43 AM

To: ASP Databases

Subject: [asp_databases] Re: javascript not running in netscape





 Michael,



Did you try it by replacing the space in the code by   ?

Just curious if that would do the trick too



Koen





-----Original Message-----

From: Michael Goldman

To: ASP Databases

Sent: 25/11/00 23:01

Subject: [asp_databases] Re: javascript not running in netscape



the problem went away when I renamed the javascript test file to remove

a

space.  I guess Netscape doesn't like spaces in filenames.  Sorry if I

wasted your time.



happy trails



(Not a waste of time, still useful to know! moderator)





Message #6 by "Michael Goldman" <mg188@h...> on Mon, 27 Nov 2000 14:44:18 -0800
Koen,

The problem was with the filename, not the code.  Thanks for the suggestion,

though

Mike

----- Original Message -----

From: "Van Tolhuyzen Koen" <Koen.VanTolhuyzen@c...>

To: "ASP Databases" <asp_databases@p...>

Sent: Monday, November 27, 2000 12:43 AM

Subject: [asp_databases] Re: javascript not running in netscape





> Michael,

>

> Did you try it by replacing the space in the code by   ?

> Just curious if that would do the trick too

>

> Koen

>

>

> -----Original Message-----

> From: Michael Goldman

> To: ASP Databases

> Sent: 25/11/00 23:01

> Subject: [asp_databases] Re: javascript not running in netscape

>

> the problem went away when I renamed the javascript test file to remove

> a

> space.  I guess Netscape doesn't like spaces in filenames.  Sorry if I

> wasted your time.

>

> happy trails

>

> (Not a waste of time, still useful to know! moderator)

>

>

Message #7 by "Michael Goldman" <mg188@h...> on Mon, 27 Nov 2000 23:46:55 -0800
Not sure we're on the same track.  To clarify my original problem, I had

named the test file A B.asp.  This didn't work in Netscape.  When renamed

AB.asp, it worked fine.  That the file contained javascript client-side code

didn't seem to matter, though that's where I originally thought the problem

lay.  Anyway, thanks for the input.



happy trails

Mike

----- Original Message -----

From: "Eric Van Camp" <eric.vancamp@c...>

To: "ASP Databases" <asp_databases@p...>

Sent: Monday, November 27, 2000 4:55 AM

Subject: [asp_databases] Re: javascript not running in netscape





> correct, but as others told me, use server.urlEncode() for this to give

> strings. The server will rework the string correctly!

>

> -----Original Message-----

> From: Van Tolhuyzen Koen [mailto:Koen.VanTolhuyzen@c...]

> Sent: Monday, November 27, 2000 8:43 AM

> To: ASP Databases

> Subject: [asp_databases] Re: javascript not running in netscape

>

>

>  Michael,

>

> Did you try it by replacing the space in the code by   ?

> Just curious if that would do the trick too

>

> Koen

>

>

> -----Original Message-----

> From: Michael Goldman

> To: ASP Databases

> Sent: 25/11/00 23:01

> Subject: [asp_databases] Re: javascript not running in netscape

>

> the problem went away when I renamed the javascript test file to remove

> a

> space.  I guess Netscape doesn't like spaces in filenames.  Sorry if I

> wasted your time.

>

> happy trails

>

> (Not a waste of time, still useful to know! moderator)

>

>




  Return to Index