By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,663 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,663 IT Pros & Developers. It's quick & easy.

external button

P: n/a
I have this table cell that is 150 pixels wide. In it I desire to call an
external javascript file to print on the screen, in this cell, a menu and to
jump to a page when the corresponding button is pressed. I am trying to have
all my button layout and linking happen in the javascript. I am wanting to
do this in javascript so I can easily add or delete page links by just
updating the javascript page instead of having to re-compile a java program
or change a bunch of html pages. Is this possible or am I just dreaming?

Thanks,
Thad
Feb 9 '07 #1
Share this Question
Share on Google+
5 Replies

P: n/a
"Thad" <ts*****@cox.netwrote in news:Me*************@newsfe17.phx:
I have this table cell that is 150 pixels wide. In it I desire to call
an external javascript file to print on the screen, in this cell, a
menu and to jump to a page when the corresponding button is pressed. I
am trying to have all my button layout and linking happen in the
javascript. I am wanting to do this in javascript so I can easily add
or delete page links by just updating the javascript page instead of
having to re-compile a java program or change a bunch of html pages.
Is this possible or am I just dreaming?
You are trying to emulate, using Javascript, what can be done by the web
server using "server side includes." It means that the server simply
includes a text file, containing the HTML menu, in the table cell. The
syntax for doing this depends on what OS your sever is running and what
scripting languages your server provides. For further info, Google (how
do I include html file inside another)

Feb 9 '07 #2

P: n/a
VK
On Feb 9, 3:28 am, "Thad" <tsob...@cox.netwrote:
I have this table cell that is 150 pixels wide. In it I desire to call an
external javascript file to print on the screen, in this cell, a menu and to
jump to a page when the corresponding button is pressed. I am trying to have
all my button layout and linking happen in the javascript. I am wanting to
do this in javascript so I can easily add or delete page links by just
updating the javascript page instead of having to re-compile a java program
or change a bunch of html pages. Is this possible or am I just dreaming?
With SSI as an obvious alternative,

<table ...>
...
<td>
<script src="menu.js"></script>
<noscript><p>Oopsy-poopsy... Script disabled...</p></noscript>
</td>
....

where menu.js prepares menu content and then document.write(it);

Feb 9 '07 #3

P: n/a

"VK" <sc**********@yahoo.comwrote in message
news:11**********************@a34g2000cwb.googlegr oups.com...
On Feb 9, 3:28 am, "Thad" <tsob...@cox.netwrote:
>I have this table cell that is 150 pixels wide. In it I desire to call an
external javascript file to print on the screen, in this cell, a menu and
to
jump to a page when the corresponding button is pressed. I am trying to
have
all my button layout and linking happen in the javascript. I am wanting
to
do this in javascript so I can easily add or delete page links by just
updating the javascript page instead of having to re-compile a java
program
or change a bunch of html pages. Is this possible or am I just dreaming?

With SSI as an obvious alternative,

<table ...>
...
<td>
<script src="menu.js"></script>
<noscript><p>Oopsy-poopsy... Script disabled...</p></noscript>
</td>
...

where menu.js prepares menu content and then document.write(it);
Nice....very nice. I had it working then arachnofilia started bugging out
on me and I lost my data. Starting over again, but I understand where you
are coming from.

Thanks a bunch.
Thad
Feb 10 '07 #4

P: n/a
I don't see anything wrong with this code. Just by looking, can you see
anything wrong?

document.write("<Button Type=Button style=\"width:180;height:25\"
style="background-color:#4ae3ec\" onClick=navigate(\"makeu5503.html\")>" +
Make One + "</Button>") ;

If code looks ok then I have to investigate further. External js page is
called like this...

<script type="text/javascript" src = "menujs.js">
</script>

The file is saved under menujs.js so I see nothing wrong but no button
shows...any suggestions?

Thanks,
Thad

Feb 10 '07 #5

P: n/a
Hah....answered my own question by playing with if for quite a while....

document.write("<Button Type=Button style=\"width:180;height:25\"
style=\"background-color:#4ae3ec\" onClick=navigate(\"makeu5503.html\")>
Make One </Button>") ;

Two double quotes had to be taken out...waaahhhhoooo.
"Thad" <ts*****@cox.netwrote in message
news:M0*****************@newsfe16.phx...
>I don't see anything wrong with this code. Just by looking, can you see
anything wrong?

document.write("<Button Type=Button style=\"width:180;height:25\"
style="background-color:#4ae3ec\" onClick=navigate(\"makeu5503.html\")>" +
Make One + "</Button>") ;

If code looks ok then I have to investigate further. External js page is
called like this...

<script type="text/javascript" src = "menujs.js">
</script>

The file is saved under menujs.js so I see nothing wrong but no button
shows...any suggestions?

Thanks,
Thad

Feb 10 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.