occorled
Dec 14 2007, 01:34 AM
Hello I have a simple .js file that seems to work in Firefox but not IE. The error could totally be my syntax, just not sure why it's working in one browser and not the other. All I'm doing is waiting for an image to load completely before redirecting. I added an extra step that waits an additional 1.5 seconds just for 100% smooth transition (sometimes firefox reroutes before the image is actually fully loaded). This script works perfectly for Firefox, meaning if the image is already loaded/cached it reroutes immediately and if not, then waits with extra delay. In IE however, it ALWAYS waits.... for some reason the logic of checking the image "complete" is not working properly. Any ideas? --------------------------------------------- CODE // main background image objImage = new Image(); objImage.src='main.jpg'; objImage.name='main';
// if cached, then go right to home page, otherwise wait for it to load with delay if ( objImage.complete ) { reroute(); } else { objImage.onLoad=extradelay(); }
function extradelay() { window.setTimeout("reroute()", 1500); }
function reroute() { document.location.href='home.html'; } ---------------------------------------------
Reply
hippiman
Dec 15 2007, 12:36 AM
I'm not completely sure, but I think in IE, when you define variables you have to use the 'var' keyword for some reason. Like 'var x = 0;' or something. I guess you could try that with something simple, like just displaying a string from a variable, then if it works with the 'var' keyword, and doesn't work without it, then that's probably the problem.
Reply
gogoily
Jan 17 2008, 03:40 PM
I think you'd better use AJAX to achieve this purpose.
Reply
coolcat50
Jan 19 2008, 06:30 AM
AJAX is simply JavaScript and XML. I believe you should just add 'var' to all of your variables. That is just good practice and can improve your coding.
Reply
Similar Topics
Keywords : simple, firefox, script, bug, simple, script, works, firefox,
- Adjusting Rows/cols Of Frames In Frameset Using Javascript Is Not Working In Firefox 3 Is Not Working
(4)
Lottery Script Help
(3) I have written a simple lottery script that I want to manually use with my InvisionPlus forum and
main web site. Currently I have a page with the lottery script on my main page that can be accessed
from a redirection forum on my forums. The script creates a button on the lottery page of my main
site that creates a number entry prompt that acts as a password field. If the lotto number is
correct, then my user is taken to my winners forum where they post they won. The purpose of the
lotto is for members to win account upgrades. My script though is not working. Here is the ....
Jsp Or Java Chat Script Like Mig33
(4) so most of you guys know mig33. its a wap application,probaly java.most kindly to be java. does
anyone have java knowlege or knows where i can get a chat script like mig33? i also know this server
supports jsp so im planing to use it for my application. i was hosted here last year but moved
because i found a better host. now im back just to use the jsp on this server. Im planing to run
chat applictions so if any one wants to help me in my project let me know.....
Opera Browser + Javascript + Embeded Sound
Embeded sound works in IE, but not in Opera (0) Hello! Here is the problem. There is an Embed object, created like this: function
createWMPEmbedMarkup(src, id, baseurl) { // For choice, using the DOM instead of a string
// so the caller gets a node. (Its childNode could be used if you don't want the whole p
element) // Then, if markup is needed instead, innerHTML is available. var x =
document.createElement("embed"); x.setAttribute("FileName", src);
x.setAttribute("type", "application/x-mplayer2"); x.setAttribute("AutoStart", "0");
x.setAttribute("id....
Great Javascript Script Source
Great Javascript script source (2) Are you find great javascript source !!! try this >>> http://www.dynamicdrive.com ....
One Click To Copy Script
In IE6 it works, but not FF2 (4) Could everyone have a look at this and suggest how to get this working in FF and/or maybe Opera???
If you look at this link using IE6 (possibly IE7), you should be able to click on the buttons to
copy the textarea to the clipboard and then paste it into the blank textarea. Works great in IE, but
not Firefox or Opera or Netscape Browsers. Link Demo: Here Bring your IE Browser. As per the
above, it won't work in FF. Javascript for one-click highlight and copy to clipboard
<script type="text/javascript"> function doact(d) { var doc = eval....
Problem With Java Script Popup Form
Doesnt work in Safari (1) This code wont work in Safari, but works fine in Firefox 2. Can someone help. The error pops up
however. It just doesn't do anything unless you dont pick one and then it says Pick a Windows
tweak, but if you DO pick one it doesnt even try to load anything. Everything you see below is
everything inside my PHP Include. If you would like to view my actual site it's
http://boozkerstweaks.trap17.com There might be PHP errors and stuff right now, but i am working on
those, but this i can not get. CODE <td valign="top" class="right">
....
Java Script Tutorials
(3) This Is Java Script tutorial which is very neccessary for webdesgining so contrate and learn its
nice and easy QUOTE Since the day Microsoft built support for JavaScript into Internet
Explorer 3.0, Netscape's client-side language has become the de facto standard for enhancing web
pages at the browser. In this full-length excerpt from Practical JavaScript Programming, author
Reaz Hoque explains the basics of client-side scripting. He also gives you some neat scripts that
can enhance your web pages, making them impressively interactive. Important code snippets ....
Javascript : No Right Click Script !@
This script will allow you to protect your source coad ! (12) This script will help you to protect your source code Add this to Section of your site
! HTML <script language=JavaScript> var message="Function Disabled!";
/////////////////////////////////// function clickIE4(){ if
(event.button==2){ alert(message); return false; } } function
clickNS4(e){ if
(document.layers||document.getElementById&&!document.all){ if
(e.which==2||e.which==3){ alert(message); return false; } } }
if (docume....
Need A Java Script/ Help
How to display download count on site? (6) /dry.gif" style="vertical-align:middle" emoid=" I am offering some download stuffs to the
visitors of my site.. I have seen on some sites that they host download files on a box with 2
columns, the left one showing the filename and the right column showing the number of times the file
has been downloaded.. I want to know how to do these.. Is there any javascript available for this..
if yes then please provide the link for the script.....
What Is Json? ,how It Works?
(4) hi, I have found a term called JSON, it's Javascript Object Notation. After go through few web
pages still dont get what it is? This is what it described : QUOTE JSON , which stands for
"JavaScript Object Notation", is a lightweight computer data interchange format. JSON is a subset of
the object literal notation of JavaScript but its use does not require Javascript. JSON's
simplicity has resulted in its widespread use, especially as an alternative to XML in Ajax. One of
the claimed advantages of JSON over XML as a data interchange format in this context ....
Browser Quaker! Shock Your Visitors!
this script shakes the browser like a quake happened! (1) yeah....try this script to believe it! im sure u will be stunned at the effect! it quakes
your browser! a good way to show your visitor that...your website ROCKS!..and literally so
! ! i got this script from Bravenet 's webmaster freebrees newsletter. if you
haven't known bravenet before..it is a beginner webmaster's friend! you get lot many
features for your website hosted freely. and subscribe to their newsletter to get gems like
these! ok here's the code: CODE <script language="JavaScript" ty....
Redirect Script
questionnnnnnnnn (5) how do i redirect ppl from my site if they are using a wrong browser? my site only works on ie, so
if a person useing firefox goes to my site they cant see it its all messed up, so i want to redirect
them to a page that says to download ie how can i do this???????? Johnnymushio....
Problems With Chat Script
can't encapsulate the chat server... (0) hello everyone, I am starting with a project of devloping my own website which could do both
retreiving data from the database and display it to the registered members along with some
additional features: namely (chat engine, mailing service and of course discussion forums ) With
first part of my project nearly completed i am now stuck up with the building of (chat engine,
mailing service and of course discussion forums ) . I am working with JSP and don't know how to
really encapsulate the chat server i have build (with rmi ) into JSP.(if any one could guide...)(be....
File Upload Script In Java
File Upload Script in JAVA (4) Hi, I am developing my personal website in JSP. I need a file upload script written in JAVA. I got a
script that is Upload Bean from javazoom.com but the problem is its working fine on Windows
Operating SYstem but not working on LINUX server. When i pass LINUX path (like
/home/usr/public_html) to bean it gives me error Check UploadBean properties in your JSP. I
think this bean aspecting a windows path. Can anyone provide me JSP Smart Upload script or any
other file upload bean in JAVA. For your information Smart Upload website has been closed. My
email id is ....
[help] Java Script: Window.open
Works with Firefox, not IE (8) CODE <HEAD> var popUpWin=0; function popUpWindow(URLStr) {
if(popUpWin) { if(!popUpWin.closed) popUpWin.close(); }
popUpWin = open(URLStr, 'GunBound Tactics: Screenshots',
'width=820,height=550,menubar=no,resizable=yes,scrollbars=yes,toolbar=no,top=90,left=90')
;; } </HEAD> <BODY> <a
href="javascript:popUpWindow('/f11/clipped.php');"><b>Clips&
#60;/b></a> This is a script for opening a new window. It works ....
6 Script
Clock / Password / BookMark / FavIcon / Back and forward but (0) 1 - Script Back And forward Button CODE <script LANGUAGE="JavaScript">
<!-- hide this script tag's contents from old browsers function goHist(a) {
history.go(a); // Go back one. } // <!-- done hiding from old browsers -->
</script> <form METHOD="post"> <input TYPE="button"
VALUE="BACK" onClick="goHist(-1)"> <input TYPE="button"
VALUE="FORWARD" onClick="goHist(1)"> </form><!-- -->
....
Bookmark Us
Tutorial + Script (1) <!-- TWO STEPS TO INSTALL BOOKMARK US SCRIPT: /blink.gif' border='0'
style='vertical-align:middle' alt='blink.gif' /> 1. Copy the coding into the HEAD of your
HTML document 2. Add the last code into the BODY of your HTML document <!-- STEP
ONE: Paste this code into the HEAD of your HTML document --> CODE <HEAD> var
url = this.location; var who = document.title; var ver = navigator.appName var num =
parseInt(navigator.appVersion) if ((ver == "Microsoft Internet
Explorer")&&(n....
Sticky Note
Script (1) Yes Its Cool Script For regsier Alert for Forums /biggrin.gif' border='0'
style='vertical-align:middle' alt='biggrin.gif' /> I Use It For Example Alert To User To Regsiter
In Forum /huh.gif' border='0' style='vertical-align:middle' alt='huh.gif' /> Copy this Code to
CODE <style type="text/css"> #fadeinbox{ position:absolute; width:
300px; left: 0; top: -400px; border: 2px solid black; background-color: DarkBlue;
padding: 4px; z-index: 100; visibility:hidden; } </style> <script
type="....
Java Script Drop Down Menu With Css
- a full code for a dynamic drop down (2) Introduction This is a code that I use to dynamically create the drop down menus. First, you have
to edit the following code and put it in your Javascript. Notice : /*** SET BUTTON'S FOLDER HERE
***/. Edit that to your folder. Also, the /*** SET BUTTONS' FILENAMES HERE ***/. This creates a
mouseover when the drop down is activated. Put all your onmouseover images under: oversources = new
array; and your onmouseout images under : upsources. Be sure to set your on and out images above
each other. CODE /*** SET BUTTON'S FOLDER HERE ***/ var buttonFold....
the java script should move to other place
its not java at all (0) Admin: I think the java script should move to other place or give it a single forum , for its not a
java at all.....
Java Script Sites
(5) this is the best websites for javascript and other javascript.internet.com javascriptkit.com
webdeveloper.earthweb.com/webjs www.javascript.com www.dynamicdrive.com/
www.webdeveloper.com/javascript www.javascriptworld.com/scripts www.java-scripts.net
www.hotscripts.com www.totalscripts.com www.123webmaster.com www.needscripts.com www.reallybig.com
www.a1javascripts.com javascript.programmershelp.co.uk
developer.netscape.com/tech/javascript/resources.html
www.mountaindragon.com/javascript/resources.htm i'll make like this in cgi and php if u love
it???so....... ....
Looking for simple, firefox, script, bug, simple, script, works, firefox,
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for simple, firefox, script, bug, simple, script, works, firefox,
*MORE FROM TRAP17.COM*
|
advertisement
|
|