Code Runs Slower In IE9 Than IE8
May 14, 2011
I'm having difficulty in explaining why the following code runs slower in IE9 than IE8! (Testing in Win 7 IE9 both 32 bit and 64 bit running in VMWare 3 virtual machine on OS X 10.6.7)
Here's some test code that runs smoothly in about half a second in (latest) FF/Chrome/Safari on OS X, WinXP, and Win7 plus IE7 & 8 on WinXP (for simplicity I removed the tweak that makes it work in IE6).
For some reason I can't explain, it's awful in IE9, slow and clunky. Reducing the time for the setTimeout makes it a bit quicker but no less jerky.
I've tried removing and benchmarking a number of what might be the choke points (Math.min for example ... all with no change.
Here's the test code ...
View 2 Replies
ADVERTISEMENT
Feb 23, 2010
Does anyone know why these event codes run twice? E.g. I am using a cookie to keep track of [Ctrl] + [Shift] + [F] by incrementing a variable once everytime it is used. However the code for it runs twice and thus the variable is never odd as it always increments by two.It's the same for the other events, such as [Ctrl] + [Shift] + [S], it runs twice. This was not occuring when I first inserted the cookie code last week. I have read about "bubbling" but I cannot seem to stop the code running a second time.EDIT: Internet Explorer (6+) is only browser code needs to work in.
document.addEvent('keydown', function(event) {
var event = new Event(event);
if (event.key == 'f' && event.control && event.shift) {
[code]....
View 1 Replies
View Related
Sep 16, 2011
I have seen this on websites before where the website will be one page. And you have to scroll down our sideways to view the different sections of the website like "about", "contact" etc. But when you scroll the background scrolls slower than the foreground. King of like how the android phones work when you swipe home screens and the background moves just a little bit. I heard it was done using JavaScript but I have Google my brain off and cannot find much on it.
View 2 Replies
View Related
Jan 18, 2010
I've been using jquery for some time, and was very excited about the improvements in jquery 1.4 I have found however, that in one particular instance, jquery 1.4 seems to be performing slower than 1.3x, to the point that it has forced me to downgrade the script. I use jquery heavily throughout my web application; in this particular case, when a very large block of html consisting of a bunch of <tr>s is .appended (or .htmled, tried both) to a table, jquery 1.4 in firefox will give the "unresponsive script" error, prompting the user to stop, debug, or continue. The same block of html works perfectly fine in jquery 1.32 (and quite fast too). I haven't had time to do too much experimentation, as this is in a production environment, and thus downgrading was necessary as it was breaking the page, but I would love to figure out why this is happening so that I may optimize the code sometime in the near future. Have the improvements to .html resulted in code that causes higher cpu usage, or that would have a much higher overhead on longer strings? I've commented much of the code around the call, so that it pretty much consists of an ajax call that returns a chunk of html, which is inserted to a table (that I first empty). I thought it might be something with event bindings that occur after the insertion, but removal of these event bindings does not resolve the unresponsive script error. It seems the .html or .append is doing it. Note that this code, as is, works perfectly in jquery 1.3, even with event bindings, etc.
Does anyone have any ideas? My next step was going to be to try returning the entire table including the <table> tags, and doing a replace instead of an append, but if anyone has other suggestions to try, please let me know. Also, just as an aside, what do you guys consider the 'best practice' to be when returning dynamic data for a table (server side sorting, filtering etc from a db) ? Do you return just the data in json, and repeatedly clone a row element, replacing the values in each row (thus decreasing the size of the ajax call, but increasing the client side processing), or return the full html, and replace the innerHTML of the table?
View 2 Replies
View Related
Jul 11, 2009
I am running a sliding menu on my website and it runs fine on my Moz FF browser but not in the IE version.This is the script I am using:(There is a couple of lines of php at the topbut main bit is javascript)
<PHP
echo '
<div id="divStayTopLeft" style="position:absolute">
[code]....
View 3 Replies
View Related
Aug 3, 2010
I'm trying to put together this expandable menu that runs sql (using javascript and php). I've got the code below but I'm horrible with javascript and I can't get two things to work.I cannot figure out how to use the closall() function so that when the page opens all selections are closed.I'm trying to get the mouseover colors and clickable areas and the only way I know how to do that is with a table so I thought I'd put a quick table in between the <li> but can't figure out the whole onClick= to incorporate the # so that I can get rid of the <a href> tag part...
Code:
<?php
require("connect.php");
[code]....
View 3 Replies
View Related
Jul 17, 2010
i have this code:
Code:
<script>
setInterval(function() {SwitchPic()}, 4000);
[code]....
View 5 Replies
View Related
Jul 20, 2005
I have a html document, in which I include two standard libraries of
functions (supposed to help me with cross browser issues), and one
application-specific script file. All Javascript fcoz.
The very first attempt at invoking a function from this last script file
fails miserably in IE (6) but works as it should in Moz (1.4)
I have tried putting alert()s here and there, so I (think I) can tell
the exact spot where IE dies.
Structure is like this (all in HEAD):
<script type="text/javascript" src="../libPlatform.js"></script>
<script type="text/javascript" src="../libDOM.js"></script>
<script type="text/javascript" src="tooltip.js"></script>
<script type="text/javascript">
function register() {
initAPI();
alert('after init');
regTooltip('a1');
alert('after dreg-1');
regTooltip('a2');
}
</script>
initAPI sits in libPlatform, and executes. I get to see the first alert.
And then, boom, IE script errors on page: Object expected (points to
'regTooltip')
Am I missing something here? If my code is wrong, why is Mozilla so
forgiving about it? How can I persuade IE to get the function?
Note: if I put regTooltip() right above register(), so locally in the
document, it works.
View 3 Replies
View Related
Mar 4, 2011
I'm making a website at [URL].. and I'm trying to create a menu using Jquery 1.3.2. Anyways, if you look at the tabs in my header, they have an effect but it only works once. After I mouse over the same tab a second time, they do not animate. I also have a similar menu at [URL].. You may notice the second menu also will fade to a darker gray. If i copy and past that code into my drupal block, it will still only animate one time. Do i need to include something extra because its version 1.3.2??? I also have another Jquery plugin below the header which is called a S3SLIDER. I'm not calling the jquery script up more than once.Here's the code for the Jquery menu at adc-design.com:
[Code]...
View 1 Replies
View Related
Mar 8, 2010
I have a function which is called twice. It allows the elements of an array to be set to a different color, successively:
function ln8 (arrayA,color,current) {
var arrayB=(typeof arrayA == 'string')? arrayA.split(',') : arrayA;
var line = document.getElementById(arrayB[current]);
[code]....
View 8 Replies
View Related
Feb 1, 2011
my AJAX is working in FF and Opera just fine, As in it repeats the function whenever the button is clicked, but in IE the first click works, but then it doesn't repeat...I've been searching around form some fixes, and found quite a lot but none of it seems to work [as you can see i've tried adding '.live' but still nothing]
Heres' the code:
<script type="text/javascript">
$(document).ready(function(){
[code]....
This is currently at the top of my index.php, but the button to run this function is echoed by php which I feel may have something to do with it?
View 9 Replies
View Related
Apr 23, 2010
Thought I might gives this a go instead of the usual flash. Installation went fine, but the images runs a bit inconsistently? Images are 30-50kb which shouldn't be a problem. [url]
View 2 Replies
View Related
Jun 30, 2009
I currently have a timer that counts down and what I would like is when the times runs out it then displays text or html (answer to question). I currenlty have the timer counting down and a seperate js show answer link that will show the div.
View 9 Replies
View Related
Feb 23, 2010
function update(value1){
doAjax("behind_scan.php" , "id="+value1);
}function doAjax(url , str ){
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null){
alert ("Browser does not support HTTP Request");
return;
}url=url+"?"+str;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}function stateChanged(){
if (xmlhttp.readyState==4){
//document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
//alert(xmlhttp.responseText)
document.forms.myform.scanner.value = "";
document.forms.myform.scanner.focus();
}}function GetXmlHttpObject(){
if (window.XMLHttpRequest){
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}if (window.ActiveXObject){
// code for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
} return null;
}
This pages calls a function on a separate php page to run 2 mySQL queries, the value must be put in the text 3 times in quick succession before the database is altered. I've tried all the other functions and they seem to be fine, AJAX is my weakness but I need it for the main functionality of my website. I need this to work.
View 2 Replies
View Related
Jul 17, 2006
question: if you want a link which simply runs a js function is it acceptable to have no href? the problem with this is the cursor doesnt change when you hover over, but if you put # as the href it jumps to the top of the screen which is sometimes unacceptable. what it the best solution to this? granted you could do event handling behind the scenes and just intercept the clicks and prevent the href from going anywhere, but sometimes you just want to stick an onclick on the anchor tag!
View 5 Replies
View Related
Jan 15, 2003
I'm trying to get a simple script to run where it cycles thru a few images with corresponding links and displays them on a page. I get the script to run 2 times then it breaks on the third with a runtime error saying "object expected Line 0". Code:
View 1 Replies
View Related
Dec 2, 2011
I have a jQuery script that loads and displays a small window on a mouse hover. I use jQuery AJAX to load the content on that window. Having that, I noticed that loading the response from php file (which does not have a php code, only the file has .php on its name) is slower than the same file content with .html name. I wonder if this is a common problem or there is some issue with my codes. I will post my code if needed (if that seems to be the problem).Note: I mentioned that there is no php code in the php file because I am only testing the performance currently. After it is developed, there will be (obviously) php code in it.
View 2 Replies
View Related
Aug 21, 2011
Problem in the timing of the script. The problem is that when I try to get an id of an object that was added by ajax, the script doesn't recognize it. The html:
<select id="categories" name="categories">
<option value="3">aa</option>
<option value="43">bbb</option>
</select>
When I load the page, there is this script that get the value of the #categories and use ajax to fill another select and in the same ajax, I load images by another function using the new select input that was created:
function fill_subcategories(){
parent=$("#categories").val();
$.ajax({
type: "post",
url: "ajax/sub_galleries.php",
data: 'parent='+parent,
success: function(data){
$('#sub_categories').html(data);
}});
show_exist_imgs()
}
This fills this div:
<select name="sub_categories" id="sub_categories"></select>
Right after filling the #sub_categories, I use another ajax that get images of the new id of the #sub_categories, and here I get the problem.. the js:
function show_exist_imgs(){
g_id=$('#sub_categories').val();
$.ajax({
type: "post",
url: "ajax/show_exist_imgs.php",
data: 'g_id='+g_id,
success: function(data){
$('#exist_files').html(data);
}});
}
This script doesn't recognize the id of the new $('#sub_categories') select input.. why is that?
View 2 Replies
View Related
Nov 4, 2009
I have created some code that alerts me the contents of all the child divs inside a main div
function CheckEventLayout(){
//check all divs in area and resize overlapping divs
var RunOnce;
if( RunOnce != true ){
var StartTimes = new Array();
var EndTimes = new Array();
var i = 0;
$("div#day-view-overlay").children("div.day-view-appointment").each(function(){
var DoOnce;
if( DoOnce != true ){
alert($(this).html()); .....
CheckEventLayout();
The problem is this code is on a page that is loaded via post and if you go off the page and then back onto it jquery seems to attach the function again so it runs twice. So need to unbind this function before the script runs again.
View 2 Replies
View Related
Aug 27, 2005
I change image.style.width inside a image.onload function. And surprisingly, I found that it runs the onload function on the same image again with the new style.width value. Javascript treats this as a new image! This is the same old image.
Is there a way to pervent it from runing onload the second time?
View 2 Replies
View Related
Nov 8, 2011
I m trying to check if user has selected at least one checkbox and give an alert for select atleast one.the checkbox in the forms are dynamics depends up on data received from database for ex.user has to select at least one customer to process ahead .i have written below code to validate :
alert_flag=0;
for(j=0;j<count0;j++)
{
[code]....
View 5 Replies
View Related
Apr 27, 2011
I have a self project I am exploring. I would like to play a simple sound file each time a function is run. The function runs every second, so, basically, I am just trying to get an audible click sound file to run every time the function runs. I do not know how to play a sound file thru javascript. Here is the code file thus far...
<html>
<head>
<title>Timer</title>
<link href="timer.css" rel="stylesheet" type="text/css" />
<embed src="click.wav" autostart=false hidden=true name="sound1" enablejavascript="true">
<script type="text/javascript">
var seconds = 0;
[Code]...
View 7 Replies
View Related
Dec 19, 2010
If this search function is included in an include file with other functions it will run more than once if you click another function first, then come back to it to do another search.
Code:
$(document).ready(function() {
$("a#searchowner").click(function() {
var searchval=$("#p1").val();
alert(searchval); //test alert box
$.post("findowner.php", {p1 : searchval}, function(data){
if (data.length>0){
$("#ownerIDdiv2").html(data);
}});
});
}); //end
For example if I click the next page function, then decide to click for a new search it runs more than once:
Next page function:
Code:
$(document).ready(function() {
$('a#nextpage').click(function() {
var page = $(this).attr('page');
var searchval = $(this).attr('schval');
var maxpage = $(this).attr('maxpage');
$.post("findowner.php", {
p1 : searchval,
page : page
}, function(data){
if (data.length>0){
$("#ownerIDdiv2").html(data);
} });
});
}); //end
However, if I put the first search function in a separate include file all works perfect. Why it runs multiple times if it is grouped among other functions?
View 14 Replies
View Related
Apr 12, 2009
Trying to develop drop down menu... I'm showing a div, then hiding it. It works perfectly, but I need to set a time delay... that's where the problem exists. When I add SetTimeout() to create a delay, it no longer runs correctly...
Here is the code.
Code:
View 1 Replies
View Related
Oct 11, 2011
I've got an array of names, and one ID. I need to run an ajax call using the ID and each lastname, until I get a successful hit on the ajax call. I can't quite figure out how to determine if the function that runs the ajax call has succeeded or not, it always returns false for me... Here's the code for the loop:
[Code]...
View 2 Replies
View Related
Dec 2, 2011
It seems like when I load javascript code into a page, that each item I add, such as an accordian vertical navbar, image slider, etc, that each time I add one, the page loads a second or so slower with each one added. I would like some of these features, but is this just a part of life, or are there tricks to avoid the slower load time? It is not major time but after the 2 items I mentioned, it added on about 2 seconds.
I read that $(document).ready(function() might slow me down but I do not see that statement in any of my .js files.
View 4 Replies
View Related