Image Refresh Not Working?

Apr 20, 2011

I've got an image that I want to refresh every time a certain event occurs. So in my html I've got something like <div><img name="theImage" src="anImage.jpg" alt="No image found" onclick="refreshImage();" /></div>

Then in the javascript I have

function refreshImage()
{
var now = new Date();
document.images["theImage"].src = "anImage.jpg?" + now.getTime();
}

So before I click the image to trigger the event, I change the image on the server, but keeping the same name. So the image displayed in the browser should change to the new one when I click it. But when I do this, the image DOES change, but part of the bottom gets cut off. There's enough space for the whole image, in fact if I put a border around the div, the border is just the right size, but only part of the image is being displayed. Also, it is always the top part of the image being displayed.

View 3 Replies


ADVERTISEMENT

Ajax :: Refresh Div NOT Working Correctly?

Dec 9, 2009

I have some JavaScript that calls an AJAX function that in turn refreshes a DIV. I have a working model of this for a comment box. When a user types in a comment and hits send, the data is sent to a server and only the div refreshes; not the entire page

I need to add one more level of functionality to this working model. But when I change it a bit to fit what I need it does not work!

Each comment is related to a specific mediaID, and when comments are listed they all have the same mediaID. The mediaID is changed by clicking on a flash video link which in turn calls a method that "should" refresh the comments box with the correct comments. The problem is the DIV does not refresh with the php page that I provide it; instead, it puts the home page in the DIV. In my working model the DIV refreshes with the php page that I provide it.

In the head of my page I have:

Code:

<script src="<?php echo $vars['url']; ?>mod/vcomments/views/default/js/vcomments_change.js" type="text/javascript"></script>
<script type="text/javascript">
function delvePlayerCallback(playerId, eventName, data) {

[Code]....

try the comments box - you will see it update correctly - but then select a new video - and the home page loads in it.

View 4 Replies View Related

Ajax :: Captcha Refresh Not Working?

Dec 8, 2009

I made a captcha verification in my php page and refresh the image using a simple javascript. Everything working fine in IE .. But in FF the refresh of image is not working... This is my code..

<script language="javascript">
function refreshCaptcha(){
document.getElementById('code').value='';

[Code]....

View 1 Replies View Related

Sticky Note Refresh Not Working

Jan 12, 2009

I am trying to create a sticky form. I would like to use javascript to refresh the page using drop down selection to trigger the refresh.

The problem is I cannot get it to work. See test3.

I tried two other example that worked with a submit button and no javascript See test 1 and test 3.

Note: Below you will find 3 tests I used to identify that it is the javascript that is causing the problem. Using Win 2003 server, Php, Apache and Mysql.

Code:

View 2 Replies View Related

Dynamic IFrame Height, Not Working In Ie Without Refresh?

Mar 3, 2007

When i try to dynamically change the height of an iframe in ie through a java-script to match its content (a html page containing a flash movie, it doesn't resize the iframe at first, but when i reload the same page into the iFrame it resizes as planned, how come?This script works well in firefox, safari and netscape, but i cant get it to work in ie(8, 7). And i get the same problems with every resizing script i've tried. This is the script i use:

<script type="text/javascript">
function adjustIFrameSize(iframe)
{ [code].....

I have a flash menu in the first iframe, the buttons on the menu uses getURL(siteToLoad, "contents") to load another html-page into the iframe "contents". Is it possible to make the iFrame refresh automatically though javascript so that i just refreshes the iframe once? Everytime ive tried that it just ends up in a never ending refresh-loop... How can i make this work? Is there any better script for resizing (and refreshing after resize) the iframe height so that it matches to its content?

View 7 Replies View Related

Image Refresh In Sequence?

May 24, 2011

I want the images to change in sequence when the page is refreshed not random like i have below. Also I also need text to change on refresh to because I am going to have a descritption of the image below.

[CODE]
<script type="text/javascript" language="JavaScript">
var imgs = new Array('<a href="VW_1.shtml"><img border=0 src="img/samples/VW/large_1.jpg" width=165 height=109" class="thumbnail_img">',

[Code]....

View 4 Replies View Related

Image Refresh On Error

Nov 14, 2006

I am building a preloader using the usual:

var img = new Image();
img.onload = done;
img.onerror = image_error;
img.src = 'image.gif'

Things seem to work fine except some times the loading will fail due to a problem such as network error or dropped connection or something. Then the browser will actually cache the image as failed and will not re-attempt to get it again from the server even though it would have probably succeeded on the second attempt.

I have done some testing and it seems that with Firefox I can go through the above procedure (img.src = ....) and it will attempt to get the image again. IE doesn't do that. It will immediately fire onerror again even though if it had attempted to load the image again it would have succeeded.

Any ideas how to get IE to drop the failed image from the cache and request it again from the server?

View 1 Replies View Related

Simple Image Refresh

Jan 4, 2006

I need a very simple script that will refresh a single image every blank seconds. I have this one, but I am having trouble getting it to work: Code:

View 2 Replies View Related

Back & Refresh Buttons In Popup Window Not Working

Dec 7, 2010

I've got some popup windows with help screens in them. The screens are other pages of my site specially sized to fit. Those pages have links to other pages, so users can navigate them inside the popup.So I thought I'd do two things:

1. Put a back button in the popup to let the user go back one or more pages in the help screens. But a simple button saying history.back() or history.go(-1) just does nothing.

2. Let the user refresh the pop-up content so that the user can go back to the first page of the help screen without having to close the pop-up and reopen it from the main page.But a simple refresh button saying location.reload(true) or window.location.reload() also does nothing.There is a button in there that works OK, window.close().Am I missing something fundamental about the nature of popup windows?I don't really want to have my help screens open in new browser tabs because I know people won't bother to close them.

View 6 Replies View Related

Ajax :: Refresh Image After Upload?

Jul 9, 2010

I have a script which allow users to chnage there profile image, and it allmost works perfect. The script is set up so when a user uploads a new picture it overrides the previous one, so if a user have an ID, lets say 15, the image would be called 15.jpg. The problem is that when an new upload is finished it still shows the old image, I think by cache, and thats no good. How do I refresh the image with ajax so when the script has done uploading the image is the new one?

The javascript upload.js:

Code JavaScript:
<!--
function startUpload&#40;&#41;&#123;
document.getElementById&#40;'f1_userimage'&#41;.style.visibility = 'hidden';
document.getElementById&#40;'f1_upload_process'&#41;.style.visibility = 'visible';

[Code]....

View 1 Replies View Related

Auto-refresh Image Script

Nov 28, 2007

i guess it best i explain what i am trying to do and then what i have done so u can hopefully point out my mistakes.atm i have a webserver setup at home ( local only) and an internal ftp program running on the webserver... i have an ip camera ( mobotix) ftping images every 1 second to the webserver and puting the jpg image in a folder called testpic.what i am trying to do is get a script working so that it auto refreshes the image every second.[code]this basic site puts a copy of the image1.jpg in the middle of the screen and then refresh it every second. but for some reason it displays the first one then when it refreshes the image there is no picture just the box with a cross.. now i know that the image has updated in the testpic file cus i can F5 the page to display the new image that the script should have loaded.

View 3 Replies View Related

JQuery :: FadeIn On Image Reload/refresh?

Dec 23, 2010

I'm pretty new to all this javascript and jQuery stuff, so please have patience with me if I don't understand your answers the first time. I'm toying around with a tiny page for my webcam and I'm already using jquery to update the image(s) everytime 15 seconds has gone by. I've tried implementing fadeIn so the image just fades over to the newly refreshed image, but I haven't had any luck with it.I hope some of you can lead me in the right direction as to how I can implement this function.

[URL]...

View 1 Replies View Related

More Than One Simultaneous Image Change On Page Refresh?

Jun 14, 2010

my dilemma at the moment is that I have produced a site where the client would like the logo colour/image to change on refresh which I have achieved by scouring the net for codes and altering them. Now, the client wants the shapes behind the sub-headings to match the current logo colour/image on refresh as well. This would mean if the logo changed to the blue logo, I'd need all the sub-headings to be blue, and vice versa for another 3 colours.I'm struggling to understand how I can achieve this. At the moment, I have a javascript inside the code of the index page allowing logo image change on refresh but need the sub-headings to change in sync too.

View 1 Replies View Related

JavaScript Image Refresh In Mozilla And Opera

Sep 15, 2004

We've got a server-side page (status.php) that dynamically generates a GIF image. The displayed image depends on the value of a boolean field in a database. Just calling the page displays the current value of the boolean, calling it with a parameter switch (status.php?switch) flips the database value and generates a new image. We've included headers to prevent caching of the image by the browser.

Whenever our HTML page is displayed in the browser, we just include an image that shows the current status: img src='status.php'/

We want to allow the user to click the image, which then inverts the boolean status in the database: img src='status.php' onclick='this.src=status.php?switch;'/

This works great in Internet Explorer, but both Mozilla and Opera only allow to switch once. My idea of the problem is that those browsers think like this; after one click, the src is already 'status.php?switch', so changing the src again would be redundent in their eyes, so they won't do it.

We found a temporary solution by generating the current time as a parameter in the image URL: img src='status.php' onclick='this.src=status.php?switch+(new Date());'/
However, this is not a very elegant solution.

Does anyone know a proper solution to this? This means, forcing Mozilla and Opera to load an image using JavaScript, even though the URL of the image didn't change?

View 2 Replies View Related

Full Background Auto Refresh Image

May 11, 2011

What I am trying to do: A full screen background image, that auto refreshes every 3 seconds.
How I am doing it: I am using EvoCam for my camera software. It uploads the image to my server every 3 seconds, perfectly fine. I am using "Back Stretch" for my full screen capabilities, as I found it to work best is all browsers. BackStretch

My Problem: Using backstretch, applies the background image to the page through javascript, so I dont have an <img> tag to manipulate. A lot/all of the image refresh scripts I have found, use examples where there is an <img> tag. I had used another jQuery method of doing the background that had image tags but did not work in all browsers. When I was using this method, I ran into cache problems where the new image would not load.

Where do I go? I am feeling a bit lost, being relatively new to Javascript, I am unsure of how to go about clearing these problems I have. I feel that the eventual answer is to timestamp the photos, and include the timestamp into the image refresh, and somehow make it so that I am refreshing the
Code:
<pre><code><script type="text/javascript">
$.backstretch("images/myCam.gif", {speed: 1});
</script>
</code></pre>
that controls my background image. I have found scripts that include timestamp refreshes, but the way that EvoCam timestamps the image is of a different format than the way Javascript uses

EvoCam images look like: webcam2011-05-11-16-21-34.jpg
and I thought Javascript looks relatively the same, but without the dashes.
I have a test page set up, where you can see my surly, discouraged face [URL].

View 14 Replies View Related

Image Carousel Lands On Same Item Upon Page Refresh

Nov 10, 2009

I have inherited an image scroller that works perfectly. That said, the PM said the client now wishes that upon refresh or a new landing on that page - the initial image would randomize. I thought it would be cake to fix this. Not so. I have tried Math.random at every conceivable place in the function. I get bumpkis. Here is where I think the problem is . . . if anyone would like to take a crack at this.

Code:
// 4. paging function
function gotoPage(page) {
var dir = page < currentPage ? -1 : 1,
n = Math.abs(currentPage - page),

[Code]....

View 1 Replies View Related

Image Rotation In A Banner When User Refresh A Page?

Nov 29, 2011

I am trying to create banner where the image changes when a user refresh the page. Below is the script:

// JavaScript Document
<!-- TWO STEPS TO INSTALL RANDOM IMAGE:
/* 1. Copy the coding into the HEAD of your HTML document

[code]....

View 1 Replies View Related

Image Change (Rotate) On Refresh In Sequence Order

May 26, 2011

I want the images to change (rotate) in sequence when the page is refreshed not random like i have below. Also I also need text to change on refresh to because I am going to have a descritption of the image below. So the image and text sync up together when some refreshes the page or goes page to the home page.I want the images to change like on this page Loading A Specific Image Sequence On Page Refresh Via JavaScript / DOM

Code:
<script type="text/javascript" language="JavaScript">
var imgs = new Array('<a href="VW_1.shtml"><img border=0 src="img/samples/VW/large_1.jpg" width=165 height=109" class="thumbnail_img">',
'<a href="fortshelby1.shtml"><img border=0 src="img/samples/Fort Shelby/image1-large.jpg" width=165 height=109 class="thumbnail_img">',
'<a href="jaguar1.shtml"><img border=0 src="img/samples/Jag_of_Novi/large_1.jpg" width=165 height=109 class="thumbnail_img">', .....
var max = imgs.length;
var num = Math.floor((Math.random() * max));
document.writeln(imgs[num]);
</script>

View 3 Replies View Related

Multiple Image Locations Rotate Upon Page Load/refresh?

Sep 12, 2010

I am building a site with ads that I want to rotate positions (this way I can keep it fair for advertisers- the bottom ad rotates up to the top) upon refreshing the page, searching through the site, or each time the user visits. I have three images (sponsor1.jpg, sponsor2.jpg,sponsor3.jpg) that are always displayed vertically in the right banner. I assume this is just a simple javascript slideshow tweaked a bit but can't figure it out.

I find plenty of js scripts that will rotate several images through one image location, but I want image POSITION 1 to start with sponsor1.jpg, image POSITION 2 to start with sponsor2.jpg..and so on... then upon refreshing the page image POSITION 1 is holding sponsor2.jpg, image POSITION 2 is holding sponsor3.jpg... etc

View 2 Replies View Related

Make Html Page Load Random Bg Image On Refresh?

Sep 27, 2010

I wanted help for a JavaScript code. You might think I'm lazy for not writing it myself, but the truth is I am not a JavaScript coder. I just have a really simple website and I am trying to do something for which I know JS is required but I don't know how to do it. I've also searched around but couldn't find the appropriate code.

What I want to do is to make an html page load a different background image every time it refreshes.I will have a list of background images and I want to be able to add in this list, without having to change anything else in the codes after I do this (I think this is made by making an array of images and by putting .length somewhere in the codes, but I don't know exactly how I should do this).I already know how to do an external file (.js) and link to it from my .html page.Now I want the code to put in the .js file, and the code to put in the <body> of my .html file.

View 4 Replies View Related

JQuery :: PHP: Upload An Image And Refresh Gallery Page With New Thumbnail?

Feb 22, 2011

I have a page that contains thumbnails for a photo gallery. On this page is a link to upload more images. When you click the link a modal opens that contains an upload form (jquery colorbox in an iframe) which will allow you to upload one image (plus its name, caption, etc) at a time using PHP. When the form is submitted the image uploads and the page refreshes in the modal to allow for more uploads.

Since this modal is sitting on top of the existing gallery thumbnails I'd really like for the user to see the new thumbnail added to the page after it's uploaded.

View 1 Replies View Related

Ajax :: Refresh Div - Content Consists Of An Image That Will Change On Insertion Of A Row To SQL Database

Oct 16, 2010

I have got a DIV that I need to refresh, its content consists of an image that will change on the insertion of a row to the SQL Database, however, when I use a refresh on my div it does refresh but does not change the image...

My refresh code is ajax:

And my PHP code contains the MYSQL that has a mysql_num_rows, so that PHP can see if there are rows or not.

I would like my page not to redirect or refresh on my div change.. So I would just like my div to refresh.

View 1 Replies View Related

JQuery :: Refresh Div On Page Load, Append Element To Div, Change Image On Click?

Mar 30, 2011

I have questions related to three operations using jQuery:refresh a div element on page lo append an element on top of the other elements in div change an image (pending/accepted) from the div's elements I know that there are tutorials for that, but i am so short in time.I just finished my PHP courses, and i am too tired to get into the jQuery magic right now.ere is the situation that i am confronting. I have to files: propune.php (which is basically the page that has the form and the div that should be refreshed/appended) and propuneri.php (the file that is handling ajax calls).

propune.php
(partial) http://pastebin.com/SFJ7zSRJ
propuneri.php

[code].....

View 1 Replies View Related

Refresh Parent From IFrame Makes Refresh Loop In FF Only?

Jan 2, 2009

I have this code in a page that appears in my iframe if requested from parent:

<script type="text/javascript">
parent.rrr();
</script>
The parent code is:
function rrr() {
javascript:location.reload(true);
}

So, the person clicks a link from the parent, it does a php process in a hidden iframe, which then tells the parent page to refresh. The only problem is that it puts Firefox in a constant loop of refreshing. IE and Chrome work fine. They refresh once and stop.

Though the src code opens the iframe like so: <iframe src="" style="display:none; height:1px;" name="hdplus" id="hdplus"></iframe> Firefox seems to refresh the page with the memory of the child page being in the iframe, constantly looping the child request to refresh the parent.

Why won't Firefox just accept that no page should load in the iframe, as stated in the code? I need to stop this loop, which means I need to get firefox to reset the iframe as it reloads the page.

View 2 Replies View Related

JQuery :: Refresh DIV With Full Page Refresh?

Aug 11, 2009

How to refresh DIV , without refresh entire page,Am having four DIV ,

DIV1,DIV2,DIV3,DIV4

I want to refresh only DIV! without affecting the DIV3,DIV4 ,

View 8 Replies View Related

Cancel Previous Refresh Request Before New Refresh?

Apr 13, 2011

I have the below code:

<script type="text/javascript">
function loadQuickMessageCheck(File,ID){
var xmlhttp;

[code]....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved