Simple ajax / javascript fix... giving rep!!

Discussion in 'JavaScript' started by MarcL, Feb 8, 2011.

  1. #1
    MarcL, Feb 8, 2011 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    Have you tried to change the line

    
    if(response.indexOf('.gif')!=-1){ //upload successfully
    
    Code (JavaScript):
    to

    
    if(response.indexOf('.gif')!=-1 || response.indexOf('.jpg')!=-1 || response.indexOf('.jpeg')!=-1 || response.indexOf('.png')!=-1){ //upload successfully
    
    Code (JavaScript):
     
    s_ruben, Feb 8, 2011 IP
  3. MarcL

    MarcL Notable Member

    Messages:
    4,265
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    215
    #3
    Thanks for the help! It ended up being that -1 needed '-1' and it worked!
     
    MarcL, Feb 9, 2011 IP
  4. smartifactsolution

    smartifactsolution Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i will help you in this regards contact me for more details about our company
     
    smartifactsolution, Nov 25, 2011 IP