Web Analytics Made Easy -
StatCounter javacript check image?? help - CodingForum

Announcement

Collapse
No announcement yet.

javacript check image?? help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • javacript check image?? help

    hey guys, im working with an ajax/js chat solution, and im basically trying to include users display pictures (this is an addon to a social network) i know how to do this with php like this

    PHP Code:
    if (file_exists('filepahth') {
    blahjblah
    }
    else
    {
    default 
    image blahblah

    is there a way to do that in js, like check if the user uploaded an image, and if not display a default no image pic?
    PHP Code:
    $aString is_string((string)array()) ? true false// true :D 
    [/CENTER]

  • #2
    Not possible with Javascript.

    JavaScript is purely a client-side language, and unless used with an Ajax call has no capability to read from or write to a file (except a cookie), access a database or the client's operating system, or alter the default behaviour of the browser.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

    Comment


    • #3
      yeah i ended up using it with php ajax typa thing defined a var in php . thanks anyway
      PHP Code:
      $aString is_string((string)array()) ? true false// true :D 
      [/CENTER]

      Comment

      Working...
      X