Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6867343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:17:52+00:00 2026-05-27T03:17:52+00:00

I have a very wierd problem. I created a login system with ajax and

  • 0

I have a very wierd problem. I created a login system with ajax and php.
When the userprofile is loaded the user also has a picture.
Then when i try to change the picture with iframe on a modal dialog and press Save
the image should be changed in the user profile without page refresh.
I use

$(".userPicture").attr("srs","Users/"+username+"/profileimg.jpg");

I also tried

$(".imgContainer").html("<img src='Users/"+username+"/profileimg.jpg' class='userPic' >");

Still not working

It seems that the cached image is loaded in the profile picture even if i upload new picture.
The problem is that i want to do this with ajax without page refresh.
If i reload the page the picture is changed. Any help please.
Also how can i verify specific output from $.ajax function in the success function
for example

$.ajax({
    type: 'POST',
    url: baseURL,
    dataType: 'html',
    cache: false,
    data: {
        action: "LOGIN",
        username:username,
        password:password
    },
    success: function(data) {
        if (data == "empty") {
           showError("Error: Wrong Username or Password","loginTab");
        }
        else {

        }
    }
});

When i do datatype json i can verify my data if its empty but when i do html i cant.
Is there any other way how can i handle this situation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:17:53+00:00Added an answer on May 27, 2026 at 3:17 am

    Add a cache-busting random value to the url, forcing the server to retrieve a fresh copy:

    "Users/"+username+"/profileimg.jpg?cachebuster=" + new Date().getTime()
    

    The webserver will ignore the query string since it’s just fetching a jpg, and the query string will force the browser to see it as a ‘new’ request, so it’ll bypass the cache and hit the server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very weird problem.. I really do hope someone has an answer
So, I have this very weird error - Some advanced PHP devs might also
I have a very strange problem. Recently I've created an upload page using jquery
I have a very wierd problem. I have some data which I show in
I am facing this very weird problem, I have created a custom UITableViewCell on
I have a very weird problem and has not been able to solve it
I have a very weird problem in Firefox ( version 3.5.2), and I am
I have a very weird problem with PROLOG. I have used it before, but
Hello I have a very weird problem in chrome I just cannot figure out!
I am experiencing a very weird problem: In WPF I have a tabControl which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.