Guidelines and Suggestions for web page design and coding

E

eholz1

Hello Javascript Group,

I have a couple of questions regarding use and implementation of
javascript and AJAX
for a web site, and page design. etc...

I have a web site that I am moving off of Front Page. I have created
an index.html page
that has some nice rollover buttons, using gif images for rollover,
click, etc.

These are links that allow the user to navigate the web site, and
there are 9 top level pages that all will have these buttons for user
navigation around the site.

I could copy the button code from the index page and put it on the
other 8 pages.
I am not keen on this idea, but it will work. I am used to using PHP,
CSS, and include files to "write" page elements in a div on a given
page (such as "buttons" created in CSS, with code associated with each
CSS element for navigation)

I would like to be able to use the same rollover buttons with their
links on each of the 8 pages using Javascript (like an include file)
to write the rollover buttons on each page.

PHP is easier in this respect, I have used echo statements in a php
page to write page elements (hyperlinks, tables, table rows, etc). I
have looked at using the DOM technique, document.createElement,
objTag.appendChild, etc. The code for the buttons was generated by
Dreamweaver, using gifs for rollover effects, etc. I am wondering if
this is the correct approach to add navigation elements to a web page,
and or should I implement some sort of XMLHttpRequest (ajax) to load
the "buttons" into the navigation div on the page.

Any tips or links to how to get a mile-long string of Dreamweaver code
into a DOM elements (a div in my case, with 9 p elements).

Thanks Very much,

eholz1
 
D

David Mark

Hello Javascript Group,

I have a couple of questions regarding use and implementation of
javascript and AJAX
for a web site, and page design. etc...

I have a web site that I am moving off of Front Page. I have created

Moving away from FrontPage is always a good idea.
an index.html page
that has some nice rollover buttons, using gif images for rollover,
click, etc.

These are links that allow the user to navigate the web site, and
there are 9 top level pages that all will have these buttons for user
navigation around the site.

I could copy the button code from the index page and put it on the
other 8 pages.
I am not keen on this idea, but it will work. I am used to using PHP,
CSS, and include files to "write" page elements in a div on a given
page (such as "buttons" created in CSS, with code associated with each
CSS element for navigation)

I'm not sure what you mean by that.
I would like to be able to use the same rollover buttons with their
links on each of the 8 pages using Javascript (like an include file)
to write the rollover buttons on each page.

Don't use JavaScript for that. It won't work when scripting is
disabled or unavailable.
PHP is easier in this respect, I have used echo statements in a php
page to write page elements (hyperlinks, tables, table rows, etc). I
have looked at using the DOM technique, document.createElement,
objTag.appendChild, etc. The code for the buttons was generated by
Dreamweaver, using gifs for rollover effects, etc. I am wondering if

Don't use any code generated by Dreamweaver.
this is the correct approach to add navigation elements to a web page,

No. Use a server side include.
and or should I implement some sort of XMLHttpRequest (ajax) to load
the "buttons" into the navigation div on the page.

Absolutely not.
Any tips or links to how to get a mile-long string of Dreamweaver code
into a DOM elements (a div in my case, with 9 p elements).

That sounds like Dreamweaver-generated markup. Throw it away.
 
P

Peter Michaux

Moving away from FrontPage is always a good idea.




I'm not sure what you mean by that.




Don't use JavaScript for that. It won't work when scripting is
disabled or unavailable.




Don't use any code generated by Dreamweaver.


No. Use a server side include.

Yes the includes should happen on the server side.

There are many templating systems that can help with this type of html
reuse. In the PHP world I know that smarty templates are popular.

<URL: http://smarty.php.net/>
 
E

eholz1

eholz1 said the following on 12/10/2007 11:57 AM:



Your question has nothing to do with AJAX. Your question is as simple as:

What is the best way to include a menu system on multiple pages?


At least you are getting away from FrontPage. Now, if you can just
forget you ever heard of DreamWeaver.


Sounds like a menu system on multiple pages.


There is your solution. Create the HTML for the navigation system, use
PHP to include it in each page where you want it. You want to change the
navigation, you edit one file, PHP does the rest.


You want to use JS to put HTML on 8 pages instead of a PHP include? Why?


If you know PHP is easier, and PHP is more reliable, then you use PHP.


Have you heard about the contest that MacroMedia and Microsoft were
engaged in? They were having a contest to see which program - FrontPage
or DreamWeaver - could spit out the most horrible, incompetent,
inefficient garbage code. So far, it is an undecided contest.


Use PHP and an include. Leave JS alone until you at least understand a
little bit of it.


Trash Dreamweaver and anything it produced.
End of problem with trying to get anything it produced to even remotely
resemble anything associated with HTML.

Why do people try to make things harder than they have to be?
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/

Hello Members,

Wow! Seems like you four guys do not like dreamweaver! But... since
I have spent some time with PHP, It may well be the better way to go.
I will see if I can create my nice rollover buttons using CSS and PHP
with the gifs that I have. I also will check out the site for
templates!!! and the two links to javascript.

Thanks for the input, perhaps more will come back with comments on
Dreamweaver!

Thanks Again,

eholz1
 
E

Evertjan.

eholz1 wrote on 10 dec 2007 in comp.lang.javascript:
Wow! Seems like you four guys do not like dreamweaver! But... since
I have spent some time with PHP, It may well be the better way to go.
I will see if I can create my nice rollover buttons using CSS and PHP
with the gifs that I have. I also will check out the site for
templates!!! and the two links to javascript.

What can you do clientside with PHP that cyou cannot do without PHP?

PHP does not reach the client at all, would you think?
 
E

eholz1

eholz1wrote on 10 dec 2007 in comp.lang.javascript:


What can you do clientside with PHP that cyou cannot do without PHP?

PHP does not reach the client at all, would you think?

If I use PHP (probably) - it is on server side.
Dumb question - is javascript only for client-side??

eholz1
 
P

Peter Michaux

eholz1wrote on 10 dec 2007 in comp.lang.javascript:
What can you do clientside with PHP that cyou cannot do without PHP?
PHP does not reach the client at all, would you think?
[snip]

If I use PHP (probably) - it is on server side.
Dumb question - is javascript only for client-side??

No but in the big scope of things it is rarely used on the server-
side. I think this is unfortunate as sharing code on the client and
the server is something that would frequently be advantageous.

<URL: http://en.wikipedia.org/wiki/Server-side_JavaScript>

<URL: http://peter.michaux.ca/article/3001>

Peter
 
E

Evertjan.

Peter Michaux wrote on 13 dec 2007 in comp.lang.javascript:
What can you do clientside with PHP that you cannot do without PHP?
PHP does not reach the client at all, would you think?
[snip]

If I use PHP (probably) - it is on server side.
??
Dumb question - is javascript only for client-side??

No but in the big scope of things it is rarely used on the server-
side. I think this is unfortunate as sharing code on the client and
the server is something that would frequently be advantageous.

No, not "rarely", Javascript in it's jscript dialect is used under ASP.
I do use it often, and many with me.

"The" big scope would be "your" scope, as a PHP programmer?

ASP-JS has many syntactic, and some unique advantages over ASP-VBS.
And is a joy to use, as the same coded routines can be set up both
serverside and clientside, like pre and post form-posting validation.

It can easily be mixed with ASP-VBS for the so inclinated.
 
P

Peter Michaux

Peter Michaux wrote on 13 dec 2007 in comp.lang.javascript:
What can you do clientside with PHP that you cannot do without PHP?
PHP does not reach the client at all, would you think?
If I use PHP (probably) - it is on server side.
??
Dumb question - is javascript only for client-side??
No but in the big scope of things it is rarely used on the server-
side. I think this is unfortunate as sharing code on the client and
the server is something that would frequently be advantageous.

No, not "rarely", Javascript in it's jscript dialect is used under ASP.
I do use it often, and many with me.

It may be often with you but I think it is still rare overall.
"Rarely" was a purposely vague word. It certainly isn't the most
popular server-side language.

"The" big scope would be "your" scope, as a PHP programmer?

I rarely do any server-side programming. PHP claims to be the most
popular however.

ASP-JS has many syntactic, and some unique advantages over ASP-VBS.
And is a joy to use, as the same coded routines can be set up both
serverside and clientside, like pre and post form-posting validation.

It can easily be mixed with ASP-VBS for the so inclinated.

Peter
 
E

eholz1

On Dec 10, 11:14 am, "Evertjan." <[email protected]>
wrote:
eholz1wrote on 10 dec 2007 in comp.lang.javascript:
Wow! Seems like you four guys do not like dreamweaver! But... since
I have spent some time with PHP, It may well be the better way to go.
I will see if I can create my nice rollover buttons using CSS and PHP
with the gifs that I have. I also will check out the site for
templates!!! and the two links to javascript.
What can you do clientside with PHP that cyou cannot do without PHP?
PHP does not reach the client at all, would you think?
[snip]

If I use PHP (probably) - it is on server side.
Dumb question - is javascript only for client-side??

No but in the big scope of things it is rarely used on the server-
side. I think this is unfortunate as sharing code on the client and
the server is something that would frequently be advantageous.

<URL:http://en.wikipedia.org/wiki/Server-side_JavaScript>

<URL:http://peter.michaux.ca/article/3001>

Peter

Javascript - this is a good newsgroup - thanks for the input!
eholz1
 

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
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top