external javascript not working

N

none

dorayme said:
On what do you base your opinion that many a text editor is unlikely
to do blocks all that well?

Perhaps a rash comment but taking a quick look at kwrite and it prefers
to only replace text one line at a time, rather than a block spanning
multiple lines. Had a look at the Netbeans html editor, same thing. I
could use regular expressions to get it to match newlines. Either way it
is not as simple as I believe you are making out.
Remember, we are talking 12 pages and a very
small menu indeed. A very nice menu, mind you, but very modest in
complexity.

I don't deny it is a simple menu. Let's say I have a my 12 pages (or 11
I think it is) and I decide to add one. With the JS or an include (which
btw my ISP does not support server side scripting) I am able to add one
entry the Navigation.js, get it right there and all pages will be linked
correctly. With copy an paste, I have to open each of the 12 files and
paste in the new link. It's time consuming, and if I want the link in
the middle of a few links there's a chance I will get it wrong on any
one of those.

Well, I won't get into this javascript issue, others have spoken well on
this. Please accept that I came in only because I saw you possibly
chasing after "includes" - which are very good things - while seeming to
be having so much trouble with simple HTML and copy and paste and this
sounded like some cart was getting in front of some horse given you had
12 pages and a very simple list.

I think things have appeared more complex than they are :). A couple of
pointers and you will see my page is now valid xhtml and layed out
better, you'll even see the unordered lists in there now :) - as part of
the JS.

I am biased, I see my view as urging you to walk to the shops that are
about 100 metres away rather than start up the car and risk running out
of petrol, running into the neighbours cat,

I'm not sure that is such a great analogy but . . .
contributing to global
warming, bringing peak-oil closer ... <g>

:), I've removed the peak oil counter now, it's a bit controversial for
some people unfortunately.

It's all good though, I'm heading in the right direction and I
appreciate your opinion, just doesn't mean I have to agree with it :D. I
know I'm largely ignorant on these matters, but I just don't want to
write it 12 times damn it! :D.
 
D

dorayme

[QUOTE="none said:
On what do you base your opinion that many a text editor is unlikely
to do blocks all that well?

Perhaps a rash comment but taking a quick look at kwrite and it prefers
to only replace text one line at a time, rather than a block spanning
multiple lines. Had a look at the Netbeans html editor, same thing. I
could use regular expressions to get it to match newlines. Either way it
is not as simple as I believe you are making out.
[/QUOTE]

OK, you have trouble with your software doing this. So are you saying
that my text editor BBEdit on a Mac is way special? I know it is good
but I am surprised that simple S & R (no, never mind using reg exp,
though that is handy at times) is beyond the software available to you.
Windows? I know nothing about this OS and its software really...
I don't deny it is a simple menu. Let's say I have a my 12 pages (or 11
I think it is) and I decide to add one. With the JS or an include (which
btw my ISP does not support server side scripting) I am able to add one
entry the Navigation.js, get it right there and all pages will be linked
correctly. With copy an paste, I have to open each of the 12 files and
paste in the new link. It's time consuming, and if I want the link in
the middle of a few links there's a chance I will get it wrong on any
one of those.
I keep saying in effect that you don't have to open up the 12 files one
at a time to do this stuff in a good editor but you keep ignoring it?
This is what you can do in my editor and I would be surprised you could
not do similar in cheap or free editors for Windows: Open up a dialog
box and enter text you want found, enter the text you want it replaced
with in another field. This much you will know. But I am not sure you
know about the next bit: tick the box that says Multi-file Search and
specify which folder or disk you want covered. In your case you would
tick, "ourWebsite" or whatever the folder is called in which you have
all your HTML files. You then press a Replace All button.

<http://dorayme.890m.com/alt/justPics/searchAndReplace.png>

Not trying to really persuade you to do anything, am just saying there
may be facilities or good editors that you are missing.

I don't deny that being practical is good. But code is not like a
monotheistic god. It is ten a penny. Be lavish. Let your hair down.
I think things have appeared more complex than they are :). A couple of
pointers and you will see my page is now valid xhtml and layed out
better, you'll even see the unordered lists in there now :) - as part of
the JS.



I'm not sure that is such a great analogy but . . .


:), I've removed the peak oil counter now, it's a bit controversial for
some people unfortunately.

It's all good though, I'm heading in the right direction and I
appreciate your opinion, just doesn't mean I have to agree with it :D. I
know I'm largely ignorant on these matters, but I just don't want to
write it 12 times damn it! :D.


And I don't want you to do this either (see above). Dammit, you should
not depend on js except when you sort of have to or for non must-have
features. <g>
 
N

none

dorayme said:
> Some interesting stuff

In short I don't think we are going anywhere with this.

I am interested in the multi line S&R but a quick google search does
reveal that this is rare, so I haven't been blind all these years.

Another point, I'm not using windows, I'm using Linux. I avoid windows
if I can.

Thanks

Lionel.
 
C

Chris F.A. Johnson

In short I don't think we are going anywhere with this.

I am interested in the multi line S&R but a quick google search does
reveal that this is rare, so I haven't been blind all these years.

Another point, I'm not using windows, I'm using Linux. I avoid windows
if I can.

Since you are using Linux, you have various tools that can do it.
If you write a script to do it for one file, you can apply that to
all the files:

for file in *.html ## select each html file in turn
do
: use sed or awk on "$file"
done
 
N

none

Chris said:
Since you are using Linux, you have various tools that can do it.
If you write a script to do it for one file, you can apply that to
all the files:

for file in *.html ## select each html file in turn
do
: use sed or awk on "$file"
done

Yeap, I'm aware of that. I already wrote an 11 line script that uses cpp
to #include the menu.

Lionel.
 
D

dorayme

[QUOTE="none said:
Since you are using Linux, you have various tools that can do it.
If you write a script to do it for one file, you can apply that to
all the files:
[/QUOTE]

So it is looking like I might have had a rosier picture of what is text
editor "built-in" available for non Mac in this regard than is the
reality. I do now and again wonder about no one ever seeming to be aware
of simple multiple file S&R, so is this the reason, it is as rare a
facility as a hen's tooth?
 
C

Chris F.A. Johnson

[QUOTE="none said:
On 2008-09-13, none wrote:
dorayme wrote:
Some interesting stuff
In short I don't think we are going anywhere with this.

I am interested in the multi line S&R but a quick google search does
reveal that this is rare, so I haven't been blind all these years.

Another point, I'm not using windows, I'm using Linux. I avoid windows
if I can.

Since you are using Linux, you have various tools that can do it.
If you write a script to do it for one file, you can apply that to
all the files:

So it is looking like I might have had a rosier picture of what is text
editor "built-in" available for non Mac in this regard than is the
reality. I do now and again wonder about no one ever seeming to be aware
of simple multiple file S&R, so is this the reason, it is as rare a
facility as a hen's tooth?[/QUOTE]

There isn't any need to fire up a text editor for such a simple
task.
 
N

none

andrew said:
An excellent policy :). I note however that you have not mentioned too
many of the available Linux html editors. My own experience is that
Bluefish offers _excellent_ search and replace and might be worth a try.

http://bluefish.openoffice.nl/

And if your site is about 12 pages Bluefish would, I believe, be ideal.

Installing it from the package manager as I type. I've used nvu or
whatever it is called now, and a few just normal editors. At the moment
I'm using Netbeans just because I have it and since I used it everyday
it is a familiar environment.

I'll give bluefish a run.

Lionel.
 
D

dorayme

"Chris F.A. Johnson said:
There isn't any need to fire up a text editor for such a simple
task.

If one is working on a website's HTML and CSS, at least here in Macland,
a text editor is already open. What do you blokes on Linux use to edit
HTML text, ESP? <g>
 
D

dorayme

[QUOTE="none said:
An excellent policy :). I note however that you have not mentioned too
many of the available Linux html editors. My own experience is that
Bluefish offers _excellent_ search and replace and might be worth a try.

http://bluefish.openoffice.nl/

And if your site is about 12 pages Bluefish would, I believe, be ideal.

Installing it from the package manager as I type. I've used nvu or
whatever it is called now, and a few just normal editors. At the moment
I'm using Netbeans just because I have it and since I used it everyday
it is a familiar environment.

I'll give bluefish a run.
[/QUOTE]
And when you do, Lionel, I want that you should step back and reconsider
using js as a way to save yourself bother. When you make a website, you
must *never* think of yourself, study Buddism or something to understand
this, you must put your whole soul into serving others, from the
mightiest to the lowliest (that means folk with js engines off or
faulty).

I know you don't like my analogies but if the pizza bloke delivers a
pizza, you don't expect to have to do things to it when it arrives to
make it edible, you still are hungry and expect to eat even if your oven
is not working.

When your site grows considerably bigger than 12 pages, please consider
a new host that provides include technology.
 
C

Chris F.A. Johnson

If one is working on a website's HTML and CSS, at least here in Macland,
a text editor is already open. What do you blokes on Linux use to edit
HTML text, ESP? <g>

I always have two or three (or more) emacs windows open.

Some things are faster in a shell, and while I can run shell
scripts from within emacs, it's quicker (one keystroke) to go to a
shell window and enter a command there.
 
D

dorayme

Ben C said:
Most Linux users either use vim or Emacs, both of which can certainly do
multiple file search and replace (although I can't remember offhand how
you do it in Emacs, it's been a while).

But it's just as easy to write a short script in some language. The
distinction is more blurred on Linux-- most programs either are, or
have, and certainly can be piped through, scripting languages so you're
always messing around with little bits of script either way.

Now that I don't programme much, even for fun (and it only ever was
Basic), I choose a simpler life. Nevertheless, I am jealous of this
world you speak of and I enjoyed looking at Andrew's cartoons earlier
this avo ...
 
L

Lionel

andrew said:
You may have found already that Bluefish does not do WYSIWYG which is
one of its great strengths :).

Yes, for the same reason I don't like GUI builders I also am not keen on
WYSIWYG html editors.
 
R

Roy A.

An excellent policy :). I note however that you have not mentioned too
many of the available Linux html editors. My own experience is that
Bluefish offers _excellent_ search and replace and might be worth a try.

http://bluefish.openoffice.nl/

The flash tutorial below only mentions open files, is that true?
http://bluefish.openoffice.nl/movies/search_and_replace2.html
And if your site is about 12 pages Bluefish would, I believe, be ideal.

Quanta does simple S&R, and regular expressions, on multiple unopened
files. Does Bluefish do it too?
 
B

Bergamot

Raymond said:
The little "Abyss Web Server" supports php - why not giving a try ?

Installing Abyss (or any other web server) locally won't do much good if
the hosting service doesn't support php.
 
J

Jonathan N. Little

Bergamot said:
Installing Abyss (or any other web server) locally won't do much good if
the hosting service doesn't support php.

In that scenario preprocessor is the way to go.
 
D

dorayme

andrew said:
....

I suspect that you already have access to vim, emacs, gcc etc if you are
running a Mac?

Oh yes, modern OS X gets access to lots of Unix, it is, after all, built
on it. I have run one or two programmes via X11.app on my Mac.

But there are priorities, you see, in life. I am watching a few things
closely at once:

1. The US Presidential race

2. How far the Americans, with NATO in reluctant tow, are prepared to
get into the Pakistani tribal areas

3. When the hell Mugabe is going to get some sort of real comeuppance

and

4. What is going to happen to poor Albert and his validator and whether
he has mentioned me in his will.
 
D

dorayme

....
People watch me bashing commands into a terminal and say they're looking
for something easier to use. But I've seen the rows of so-called people
in offices clicking mice repetitively to make pellets of food appear.
The truth is, either you program the computer or it's going to program
you.

Old Mac hands do use lots of scripts for various things, AppleScript for
one thing has been part and parcel of Macs through many OSs. And there
are many facilities in Macs to automate stuff apart from what comes
inside programs like Photoshop and Illustrator.

It is pleasurable to make up a program or a script or action and let the
machine work hard. It gives me the illusion of being human like you.

One job I do that can take as long as a two course breakfast and Sydney
Morning Herald is to convert a DVD full of high res and very large pics
meant for high end magazine production to sizes manageable for website
work. I like seeing the machine literally open pics and resize them,
convert them in various ways. The words "Look Ma, no hands" spring to
mind...
 
J

Jonathan N. Little

dorayme said:
Old Mac hands do use lots of scripts for various things, AppleScript for
one thing has been part and parcel of Macs through many OSs. And there
are many facilities in Macs to automate stuff apart from what comes
inside programs like Photoshop and Illustrator.

It is pleasurable to make up a program or a script or action and let the
machine work hard. It gives me the illusion of being human like you.

One job I do that can take as long as a two course breakfast and Sydney
Morning Herald is to convert a DVD full of high res and very large pics
meant for high end magazine production to sizes manageable for website
work. I like seeing the machine literally open pics and resize them,
convert them in various ways. The words "Look Ma, no hands" spring to
mind...

Not restricted to a Mac. I do the same things with my PHOTO-Paint via
VBA and even with IrfanView (freeware) via macro... I have various Perl
and batch file scripts that automate all kinds of things including
backups and archives. All OS's have this capabilities, just most Windows
users are ignorant of anything beyond the GUI and most Mac folks I know
are even more so...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,091
Messages
2,570,605
Members
47,225
Latest member
DarrinWhit

Latest Threads

Top