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
ADVERTISEMENT
Jul 23, 2005
I am trying to test changes to my site (made only on my local machine so
far) in IE v6, Mozilla 1.6, and Opera 7.5.
When I test "navigator.javaEnabled in IE it corretly reports true/false
depending on whether javascript is enabled.
However, both Mozilla and Opera *always* return false. How can I properly
test to see if javascript is enabled/disabled in these two browsers? (If you
have a reference on the web, please point me to it as I've spent several
hours trying to find what I need.) Code:
View 1 Replies
View Related
Jul 16, 2009
had this in browsers areas but people told me I should put it here in Javascript because more people here would probably have seen it before and know why it happens. I have basic Javascript that rotates images. I've noticed any kind of Javascript code that rotates images has this same problem only in Mozilla. When the images rotate in Mozilla in between the rotations, Mozilla browser adds a little colored square that represents a blank image that are able to be seen does anyone know why Mozilla Browser adds that? For example when looking at this page in Mozilla can see it. if you know if this is some Mozilla problem with Javascript and images. Doesn't happen with IE and other browsers shows the images only and nothing else.
View 2 Replies
View Related
Jul 23, 2005
How do you view javascript errors in Opera?
IE pops them in a modal box and NS has the excellent javascript console.
What does Opera have?
View 2 Replies
View Related
Jul 20, 2005
I've been trying to make this simple script compatible across various
browsers. It works for IE 6.0 and NS 7 but doesnt work with Opera (I
have version 7.11). This is what is supposed to happen: when the user
clicks a button in the main window, a dialog window pops up. In the
dialog the user enters a university to search for. When the string is
submitted, the dialog then shows all the matches found in the
database. The user picks one and clicks the Submit button. The Submit
button's code is as follows:
View 6 Replies
View Related
Jul 20, 2005
can somebody give me a minimal example of how to read xml
file into mozilla AND run some Javascript funcion?
Mozilla can read xml files directly and css files can
be included as well, that works for me.
But I would like to do some operations with the DOM tree.
My question is Mozilla only, I would apperciate some
minimal example (like alert(1)) and especially some
URL pointers.
View 2 Replies
View Related
Sep 8, 2001
I have a site which uses a javascript fullscreen popup window which launches from the splash page (as well as a standard browser version for those with non-compliant browsers). All works well on both Netscape and IE, but if you're using Opera and you click on the "All other browsers" version, you get both the browser version and the popup version. This will probably be very irritating to Opera users. Unfortunately, I can't just program the popup for Opera compliance as well because it won't do fullscreen - it nests under the ad/control bars. Could someone look at it in Opera and maybe suggest a solution? Opera users don't make up a lot of my user base but I really prefer to be Opera-compliant.
View 7 Replies
View Related
Jul 20, 2005
Is there any documentation or reference for the Mozilla web browsers.
Some of my older Netscape code doesnt work and the IE code still doesnt work ..
View 2 Replies
View Related
Jul 20, 2005
could you kindly help me to solve a compatibility problem that involves
Internet Explorer and NN/Mozilla.
I created a html page that contains a form (its name is "Modulo") and some
text boxes. After clicking on a button, a popup appears.
I tried to modify the text of "Testo" textbox from the popup windows by
using the following javascript code:
window.opener.Modulo.Testo.value=window.opener.Mod ulo.Testo.value + " This
will be added to Testo textbox!";
The code is correctly run by Internet Explorer and the "Testo" textbox in
the calling html page is successfully updated.
When I try to open these pages with Mozilla, the javascript code that should
update the textbox is ignored. How can I solve this problem?
View 2 Replies
View Related
Dec 5, 2003
I have looked into creating a javascript that will do a PopUp "Exit Poll" when the client backs out or links forward from the domain. It is a moderated script I found through discussions on this forum.
Now it works great in MSIE5.2.2 on MacOS10.1.5, but I'm finding I better also make sure it works in Mozilla if I have any chance of making it work on the PC side. When i try it in Mozilla, I get Javascript console saying "loadpopup() is not defined"
I've found a couple javascripts that work in MSIE but not Mozilla..this is getting irritating to say the least.
For MacOS10.3 owners using Safari, is the browser compatibility with javascript any better? I feel like I need to get away from MSIE5.2.2 altogether now. And no..I'm not buying a PC. Code:
View 2 Replies
View Related
Jun 7, 2006
I have a problem determening the preselection of a dropdown list via
JavaScript DOM:
The followin code works fine with IE and Mozilla but does not preselect
the correct element in Opera:
//snip
myCurrentElement =
window.document.getElementById(''role'');
myNewElement =
window.document.getElementsByTagName(''font'')[0];
myNewChildElement =
window.document.getElementsByTagName(''select'')[0];
for (var i = 0; i < optionArray.length; i++)
{
myNewGrandChildElement =
window.document.createElement(''option'');
myNewGrandChildElement.setAttribute(''value'',
optionArray[i]["value"]);
if (optionArray[i]["selected"]!=null)
{
//myNewGrandChildElement.setAttribute(''selected'', ''selected'');
}
myNewGrandChildElementText =
window.document.createTextNode(optionArray[i]["label"]);
myNewGrandChildElement.appendChild(myNewGrandChild ElementText);
myNewChildElement.appendChild(myNewGrandChildEleme nt);
}
myNewElement.appendChild(myNewChildElement);
myCurrentElement.appendChild(myNewElement);
//snip
View 2 Replies
View Related
Jul 23, 2005
The following posts back properlty from an "onclick" in IE, but not in Mozilla 1.7. Can anyone explain to me why not? The style class works the same in both environments.
<HEAD>
<SCRIPT language="JavaScript">
function ClickMe(Cat, Nbr, Nav){
document.forms[0].inCat.value = Cat;
document.forms[0].inNbr.value=Nbr;
document.forms[0].inNav.value = Nav;
__aspnetForm.submit();}
</SCRIPT>
</HEAD>
<form name="__aspnetForm" method="post" action="Default.aspx" ....
View 1 Replies
View Related
Jul 23, 2005
Everything works fine with Opera and IE, but not with Mozilla 1.7.3 and
Firefox 1.0 PR. When I call a function previously defined inside another
function I've got "function is not defined". Why?
View 2 Replies
View Related
Sep 27, 2007
I have a strange problem... I have a form with a text area that contains an XML document. This document can be modified by the user.
Once the document has been modified, the user pressed the "Submit" button to submit the modification (onclick=modify())... and go to another jsp page.... in my javascript, I have the following code:
function modify()
{
myRand=parseInt(Math.random()*99999999); // cache buster
var docXML=document.forms[0].xml.value;
var plist="myRand="+myRand+"&docXML="+escape(docXML);
url="modify_xml.jsp?"+plist;
document.forms[0].action=url;
document.forms[0].submit();
}
With Firefox, the problem does not occur.... but with Explorer, the form is not even submitted!!!!! Is there a workaround for this? The XML document is not even very big.
View 7 Replies
View Related
Jul 22, 2004
I have an XML page I'm trying to load with javascript to display on Mozilla Firefox. I can get this to work on Internet Explorer but it would not work on Firefox. I can't figure out what I'm doing wrong. Can someone glance at my short piece of code below and tell me why this wouldn't work on firefox? Code:
View 2 Replies
View Related
Apr 13, 2005
Firefox has a Javascript Console that has 3 panels besides "All" and "Clear": "Errors", "Warnings", "Message".
Does anyone know a way to log a message in the Message panel with JavaScript? That would really help debugging. I know there's a way involving XPCOM, but that only works with "trusted" scripts, and scripts loaded thru html aren't trusted.
View 1 Replies
View Related
Aug 23, 2006
Can anyone help me how to set default website as homepage in mozilla using java/ javascript.
Following javascripts code works in IE but not in Mozilla.
<input type="button" value="Set Default" onClick="this.style.behavior='url(#default#homepage)'
this.setHomePage('http://www.myDefaultWebsite.com')">
View 3 Replies
View Related
Jul 23, 2005
I can't get Opera to fire an event when an image object's src has
loaded. The test code I'm using is this -
---------------------------------
window.onload=go
function yo() {
alert("yo");
}
function go() {
//alert("go?");
var pic=new Image();
pic.onload=yo; // method 1
//pic.addEventListener("load",yo,false); // method 2
pic.src="serenity.jpg";
}
---------------------------------
Code is in a file on it's own referenced from the xhtml. Using either
of the two methods indicated the function yo doesn't get called.
Code works as expected in Firefox, Mozilla, Konqueror, IE. If I
uncomment the alert in go() I can see that go does actually get called.
Nothing comes up in Opera's Javascript console.
View 2 Replies
View Related
Jul 20, 2005
I'm trying to load a matching image when a link is clicked. The following
test page works OK (the pictures load when their link is clicked) in IE6 but
it does not work in Mozilla 1.5. Code:
View 9 Replies
View Related
Sep 25, 2004
For a application I am writting I need to make some table columns apear and disapear by clicking on a link. I do this by changing the "style" property in the <td> tag.
The HTML is generated by ASP.NET, which automaticly sets the style property of the <td> tag to the right value. and makes links to the right Javascript function call to change a specific property.
This is the HTML output of 2 table columns: Code:
View 1 Replies
View Related
Feb 18, 2010
I try to get an image size like this : $("a").click(function(){
[Code]...
View 5 Replies
View Related
Nov 6, 2009
I am experiencing a problem with some images I am using for navigation. In Safari on my Mac everything displays as it should. The image loads ok, I mouse over the image and it goes black and white, mouse out and it goes back to colour.
When I tested this with Firefox and Opera on my Mac and IE8 and Firefox on my Windows laptop the onmouseover image does not appear and I am left with a text link and a lot of flickering as you move the mouse about.
I have almost zero knowledge when it comes to javascript and I've got the necessary code which according to everyone works from either books or the web.
I am completely stuck as to why this simple operation is not working.
you can see the page at this address: [url]
Only the left hand image has been set to onmouseover as I was testing to see if it worked first.
I have attached the CSS and HTM files in a zip file.
View 6 Replies
View Related
Jul 11, 2007
Is there a cross browser way to change the opacity of an image? I have found a way that works for IE and Firefox but would like it to work in Safari and Opera as well.
View 1 Replies
View Related
Feb 4, 2011
Before image upload I want users to preview their choice. For some reason JS doesn't work with all browsers except FF.When a user selects file, JS preview function should insert it into #addPreview div where preview.gif is located as a default picture. If everything goes OK preview.gif is replaced with new selected file. Otherwise wrong size or file type is detected. Alert message appears in #addPreviewAlert div.Here's my code:
HTML CODE
Code:
<!-- ALERTS -->
<div id="addPreviewAlert"></div>
<!-- END ALERTS -->[code]...
Tell me why Firefox works as desired, but all other browsers don't allow any preview. They don't show any JS error messages and alerts either.
View 1 Replies
View Related
Jul 20, 2005
I have a website that uses a custom built webserver to serve the pages.
(Please don't ask me why my boss had his own web server written). I am
displaying a log of information that is an unknown number of rows. This is
currently displayed in a table.
The table is generated by some code that we had to write (thank you custom
webserver) so that the webserver will parse HTML files and fill in the tags
we created with some data before returning that to the browser, the HTML
looks a lot like ASP or JSP using the <% %> tags to denote something to be
filled in.
Now all that works fine and dandy, but in order for this log of information
to show the latest stuff, the page needs to refresh and tell the server to
go get the list of log info and fill in the HTML with the info then return
it to the browser. All this happens pretty quick, but like any site, the
page blinks while it refreshes.
Now my boss wants that page to update without refreshing (the blink annoys
him apparently). At first I said that it couldn't be done, but he said that
he didn't believe me. Thus I am forced to ask you guys.
I know you can update fields like that using JavaScript. (I made a font tag
with an id and a JavaScript function resets the nodeValue. This changes the
text without refreshing the screen). But my problem now is that I need to
POST to the server to get the information without the page refreshing
(through JavaScript?). Is this even possible? I planned on getting the
data back and document.write() it all to the page.
Any ideas?
View 3 Replies
View Related
Feb 13, 2003
Can anyone give me a script or a link to a tutorial on how to refresh the window from another window? Example:
I have a list of items and there is a link for each item to delete them. When I click delete a new window pops up asking are you sure. When I click yes i want that window to close and the main window with the list of items to refresh to show the change.
View 1 Replies
View Related