You are here: Re: php and javascript « PHP Programming Language « IT news, forums, messages
Re: php and javascript

Posted by Daniel Tryba on 11/05/75 11:17

Joe Blow <Joe@blow.com> wrote:
> Hi,
>
> Is there any particular reason why JavaScript included in php include page
> does not work?

No, php is serverside and generates something for a client, it's up to
the cleint to interpret is if it's a correct syntax thingy.

> Will this be a browser security issue? It works with FireFox,
> but not with IE, which I suppose supports the browser security argument.

> I've found it is a general JavaScript problem, but an example is:
>
> <?php
> /*snip*/
> echo "<img src='../images/go.jpg'
> onclick='javascript:document.search_form.submit()' alt='go'
> style='margin-left: .2em; vertical-align: top; '>";
> /*snip*/
> ?>

Not a complete, standalone example.... the actuall error could be
anyware in the excluded source... (but the 'javascript:' is totally
unnecessary here).

> There are other ways to use an image as a submit button, I realise, and
> maybe I should just ditch the JavaScript, but it is an unexpected problem.

This is useless use of javascript indeed, take a look at the input
element's specs. There is a specific value to the type attribute that
allows an image as submit button!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация