Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / April 2007



Tip: Looking for answers? Try searching our database.

Replacing blanks with  

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wyo - 27 Apr 2007 21:27 GMT
I'd like to display folder names without line breaks so I tried the
following replace

 folders[j] = f.replace(/ /g, ' ');

but the script stop without an error. Any idea? Is there a better way?

O. Wyss
Lee - 27 Apr 2007 22:30 GMT
wyo said:

>I'd like to display folder names without line breaks so I tried the
>following replace
>
>  folders[j] = f.replace(/ /g, ' ');
>
>but the script stop without an error. Any idea? Is there a better way?

 alert("f: "+f);
 alert("f after replace: "+f.replace(/ /g,' ');
 alert("j: "+j);
 alert("folders[j]: "+folders[j]);

--
-Lost - 28 Apr 2007 01:52 GMT
> wyo said:
>> I'd like to display folder names without line breaks so I tried the
[quoted text clipped - 8 lines]
>   alert("j: "+j);
>   alert("folders[j]: "+folders[j]);

Missing a quote on the second line.

I am confused though.  Are you wanting to replace blanks with   or \n?

Or are you wanting to replace \n with  ?

Signature

-Lost
Remove the extra words to reply by e-mail.  Don't e-mail me.  I am
kidding.  No I am not.

Lee - 28 Apr 2007 02:10 GMT
-Lost said:

>> wyo said:
>>> I'd like to display folder names without line breaks so I tried the
[quoted text clipped - 10 lines]
>
>Missing a quote on the second line.

Look again.

>I am confused though.  Are you wanting to replace blanks with   or \n?
>
>Or are you wanting to replace \n with  ?

The OP wants to replace blanks with  , to prevent line breaks.

--
-Lost - 28 Apr 2007 04:28 GMT
> -Lost said:
>>> wyo said:
[quoted text clipped - 11 lines]
>
> Look again.

OK, I did.  I realize I meant to say parenthesis.  You are missing an ).

>> I am confused though.  Are you wanting to replace blanks with   or \n?
>>
>> Or are you wanting to replace \n with  ?
>
> The OP wants to replace blanks with  , to prevent line breaks.

Ah, was not sure since he said two different things.

Signature

-Lost
Remove the extra words to reply by e-mail.  Don't e-mail me.  I am
kidding.  No I am not.

wyo - 28 Apr 2007 08:51 GMT
> >>  folders[j] = f.replace(/ /g, ' ');
>
> >   alert("f after replace: "+f.replace(/ /g,' ');
>
> Missing a quote on the second line.

A ")" is missing but which quote? Still stops working

    alert("f after replace: "+f.replace(/ /g," "));

> I am confused though.  Are you wanting to replace blanks with   or \n?

blanks with  

O. Wyss
Lee - 28 Apr 2007 17:42 GMT
wyo said:

>> >>  folders[j] = f.replace(/ /g, ' ');
>>
[quoted text clipped - 5 lines]
>
>     alert("f after replace: "+f.replace(/ /g," "));

What does "stops working" mean?
what is alerted before it stops?

--
wyo - 29 Apr 2007 14:44 GMT
> What does "stops working" mean?
> what is alerted before it stops?

It doesn't show the alert nor anything else after the script reaches
the "replace". It neither shows an error in the error console of
Mozilla. Ditto IE6 but there isn't an error console.

O. Wyss
Lee - 29 Apr 2007 15:36 GMT
wyo said:

>> What does "stops working" mean?
>> what is alerted before it stops?
>>
>It doesn't show the alert nor anything else after the script reaches
>the "replace". It neither shows an error in the error console of
>Mozilla. Ditto IE6 but there isn't an error console.

>> what is alerted before it stops?

--
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.