You are here: Re: strange repeating of fwrite (because of javascript?) « PHP Programming Language « IT news, forums, messages
Re: strange repeating of fwrite (because of javascript?)

Posted by Tim Roberts on 04/25/06 10:54

"tihu" <tim.n.hunt@gmail.com> wrote:
>
>You were spot on about it being javascript, I think the problem is
>img.src='';
>
>Done a quick test and it seems both firefox and explorer refuse to let
>img.src be a blank string and automatically set img.src to something
>nonblank if you try. In firefox img.src was set to
>'http://server/pagedir/testpage.html' immediately after img.src='', in
>explorer img.src was 'http://server/pagedir/'. (it was x.gif before)

Yes, of course it is. This should not be a surprise, nor should it be
browser-dependent. This is a relative URL, which means that the blank
string is relative to the URL of the page it came from.

>I think this is why the php script will be called twice, once when you
>open the page in your browser, the second time when the setting
>img.src='' ends up trying to get the current page (why? silly
>browser..)

Not "silly browser". Silly programmer. That is exactly what is supposed
to happen.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

 

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

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