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

  • Home
  • SEARCH
  • 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 7591113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:34:27+00:00 2026-05-30T20:34:27+00:00

What Im Doing: Trying to call Fancybox from an iFrame to be appended to

  • 0

What Im Doing: Trying to call Fancybox from an iFrame to be appended to the parent and not the iFrame, while parsing a url for use with the Fancybox ‘href’ parameter.

Problem: This is being used for a user image upload form, the first upload produces the wanted result; fancybox popup with image. Subsequent attempts cause Fancybox to link to the first image, as if it is caching it. The url never actually changes as each upload overwrites the last image, but the image does change.
Refreshing the page will begin this cycle again. If you right click the link and open in new window/tab you get the new image, and then the fancybox will also be updated for that image.

Code: This is the code being output by the php once a user has sucessfully uploaded an image – in hope of creating a link to that image.

echo "<p>" . '<a id="image-preview" href="/images/uploads/' . preg_replace("/[^A-Za-z0-9_]+/", "", $result[0]['Klarents_Model_Project']['project_name']) . '/' . 
                        preg_replace("/[^A-Za-z0-9_]+/", "", $result[0]['Klarents_Model_Company']['company_company_name']) . '_' .
                        (($this->getRequest()->getParam('filename') !== "") ? 
                            $this->getRequest()->getParam('filename') : $result[0]['Klarents_Model_Company']['company_id']) . 
                        "." . $ext . '" onclick="event.preventDefault();parent.fbuPreview($(this).attr(\'href\'));">Image preview' . "</a></p>";`

And this is found on the parent page.

function fbuPreview(url){
    $.fancybox({
        'href' : url
    }); 
}

Regards,

  • 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-30T20:34:28+00:00Added an answer on May 30, 2026 at 8:34 pm

    You have to add a param to the image like:

    /images/uploads/something/customer/uploadedfilename.jpg?date=20120305122713
    

    This has a different URL and will not give the result as the previous image. You can not clear the cache by Javascript but adding a param which is the time. Will force the browser the load the new image.

    Currently the browser is caching the IMG URL. And if it’s the same he will always get it out of cache untill you refresh the page.

    I’ve had this problem a couple of time, the only work around is to add a param.

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

Sidebar

Related Questions

I am getting this exception while I am trying to call an activity from
I'm trying to call SendMessage with an uint parameter from Java, but I can't
I'm having a problem while trying to call a custom Model method from my
I'm trying to call a Stored Procedure from my cakephp controller.Now what i'm doing
I am trying to fake synchronous JavaScript while doing an AJAX request. I have
I'm trying to compare two different column types (not my doing, part of a
I'm trying to call a c function from my extension and have narrowed the
Hi I am trying to call a method from a method, I am getting
I'm trying to call a service from a activity: When I'm running the program
I am trying to call a SharePoint web service from Acrobat JavaScript, and I

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.