Code Only Works Every Other Time?

Nov 9, 2009

I wrote this code but it only works every other click So it doesn't work the first time it's called, but it does the 2nd time etc.Zero errors reported. What's wrong? javascript Code:

Original
- javascript Code
function move_up(obj)

[code]....

View 2 Replies


ADVERTISEMENT

Script With Document.write Inside Iframe Hangs First Time, Works Second Time (in IE)?

Dec 22, 2010

I have put together a script which does this:

1. Make ajax request (via getHTTPObject(), no libraries is used)

2. Create an iframe with script, src is "blank.html".

3. use iframe.document.write() to execute scripts (inkluding document.write based scripts) in the iframe.

4. call parent window's document to clone the iframe content.

5. Append the content clone to parent body.

Works like a charm in all browsers but IE, where every version - including IE9 beta - hangs on iframeWindow.document.close() with empty cache, leaving the window/tab unresponsible. When I force quit, restart and load the page again (now in cache) it works.What I've tried already:

* Googled.

* called the ajax request callback manually with string instead of request.responseText - it works even with empty cache here.Removed document.close() - resulting in scripts in iframe not executing at all (again, only with empty cache, cached pages works fine).

* Tested to make the ajax request synchronous - no difference.

Console.log trace:

Code:
append() begin
unlimited-scroll.js:160 install() begin
unlimited-scroll.js:194 iframe begin[code].....

View 2 Replies View Related

JQuery :: This Code Works, The Call Is Made And Text Is Added In The Other Code Don't Get A Change At All?

May 21, 2011

here is the page I'm working onhere is the jQuery in use

$(document).ready(function() { $('.error,.success').hide(); $("#send").click(function (){ $('.error,.success').hide("slow"); $.ajax({ url: 'add.php?lnk='+$.URLEncode($('[name=lnk]').val())+'&

[code]....

and in this code, it works, the call is made and text is added. in the other code I don't get a change at all. Not even in the database that add.php manipulates.

View 2 Replies View Related

JS Script Works 80% Of Time?

Jun 28, 2010

I have a site that uses a sort of coverflow to display images. The coverflow is a JS implementation.A fair amount of time, the script works fine. Other times, it does not. The page loads but the script does not start. Reloading the page usually gets the script to work.I think that the script may be trying to start before the page has finished loading. Is there a way to delay running the script until I'm sure the page has loaded? That at least would confirm this hypothesis (or not).

View 4 Replies View Related

JQuery :: Dialog In Tab Only Works First Time

Jan 3, 2010

I have a dialog that opens from inside a tab. Everything works great until I change tabs and come back. the second time I visit the tab and open the dialog my javascript does not work.I can retrieve the data from the form but its the old data from the last time it was open.the ajax does not submit and if I try debugging with firebug I see this error:[code]

When I close the dialog I am only using $(this).dialog('close');I read that I need to use remove in addition to close or destroy;so I have tried using :$(this).dialog('remove');$ (this).dialog('close');as well as destroy and I get the same results.

View 2 Replies View Related

JQuery :: ReplaceWith Works Only The First Time

Aug 17, 2010

I want to use the the replaceWith() function in a html form with many select buttons to replace the select elements from a second button to other values when the value of a first select button has been changed. The html code is generated in a perl cgi script (I write this only for completeness).The function works but only the first time when I change the value of the first button (e.g. button "Type"). On the second change no more actions are done on button "Severity".[code]I added alert() debug functions in the javascript function getOneofs() and the output looks ok.So the var "selectCode" should be also ok.

View 4 Replies View Related

Using Two Scripts On The Same Page, Only One At A Time Works?

May 24, 2011

I am currently trying to display a gallery of images using Lightbox, and a contact form in a different modal window using a different script.

Here is the URL, so you can view the source. [URL]

Clicking 'contact' opens the Contact window, which currently works, and clicking the images SHOULD open lightbox but doesn't. If I shuffle the code around, I can get Lightbox to work but the contact window then breaks.

If someone could provide just the code I should replace mine with so I can just copy and paste it in, that would be great because I don't know anything about javascript and struggled to follow the instructions for this I found elsewhere.

View 7 Replies View Related

Works First Times Error Second Time?

Jun 8, 2011

This function executes the first time correctly, but the next time the function returns an error.

function edit_div(id)
{
if(edit_status == 0)

[code]....

View 4 Replies View Related

OnMouseOver Image Loading Works Only 2nd Time?

Aug 1, 2010

I use DIV tags with onMouseOver action on the DIV-s. I want to download and show a photo if an onMouseOver activates. This is simple and works but there is a problem.First time I move my mouse cursor on the DIV the photo doesn't appear, only its border. When I move the mouse off and back again, the photo appears right. I want to show the photo first time well.There is a solution: preloading images with JavaScript invoked with the onLoad event of the BODY tag. But I would have numerous (100+) photos, so it's a bad idea to preload all the photos (and users usually want to see only a few, not all of them). It is acceptable to wait a second or two after activating onMouseOver while the photo is downloading but it's not acceptable to do TWO onMouseOver actions for a photo

View 2 Replies View Related

JQuery :: Recursive Function Works Only One (and A Half) Time

Dec 2, 2010

I've got following function:

[Code]....

I would like to run this in recursive mode, and I'm starting the function with:

$(function(){
$.bubbles();
}

The problem is, that function works only one (and a half) time. Console shows: start callback start I have not idea what is a problem. Function needs to be run constantly.

View 2 Replies View Related

Moving Multiple Images Across Screen - Only One Works At A Time

Apr 15, 2011

I am try to make images float across the screen horizontally. Ideally I would like them to come from both sides and be at different y positions.

The problem I am having is that I can only seem to get one to move at a time.

Another problem is that when they move off to the right of the screen it expands the viewable size of the site.

So here's what I've come up with thus far.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<title>Image Mover</title>
<style>

[Code]....

View 5 Replies View Related

IFrame Redirect Killer Works 1/8th The Time (Safari)?

Apr 11, 2011

I am displaying an external website via an iFrame on my website. I am using the following code to detect if the iFrame tries to redirect the parent window:

Code:
<body>
<script type="text/javascript">

[code]....

View 3 Replies View Related

Onclick Function Call Only Works One Time On A Page?

Oct 18, 2011

I have a web page a lot of thumbnail images arranged in a table. I would like the user to be able to click on the thumbnail to open a window with a larger view of the image.

So I wrote a JS function to accept a URL as the argument and open a new pop-up window with the given parameters. I need this function to potentially run multiple times from multiple links (in this case images) on the same page. However, after the first time I click the link, the function runs, and I close the pop-up, the function will not run again if I click the same or another link on the page. If I refresh the page, the function will work once and then not again. Is there a buffer I need to clear or something to reset to allow multiple links to work?

I have tried the function call in a whole slew of ways. Here's my current code (I "..."'ed out the URLs for brevity):

<script type="text/javascript">
function zoomWindow(url)
{
zoomWindow=window.open(url,"", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, height=645px, width=550px");

[Code]....

View 2 Replies View Related

JQuery :: Modal Dialog With A Datepicker Inside Works One Time Then Never?

Sep 28, 2009

I'm a developer located in Venezuela (latin america), and i have like 2 years using Jquery in every project that came to my hands. I have created a modal dialog inside a tab with a simple form that has a datepicker:

<div id="tabs-3" style="font-size:11px;">
<div style="padding-left:75%;">
<a href="javascript:void(0)"

[code]....

View 5 Replies View Related

Code Works In Firefox But Not IE 7

Jul 3, 2009

I have created a very simple JavaScript code to display larger images of a thumbnail image on the main section of a website. It works fine in FF3 however in IE 7 is giving me an error code of Invalid argument on line 6 character 1. The funny thing is I have used this exact code in another site and it worked fine with IE 7.

View 2 Replies View Related

Code Works In Chrome But Not In IE?

Jun 21, 2010

I'm just starting JavaScript and wrote a quick script for Next/Back buttons for a page showing a family outing on our boat. I proudly uploaded the webpage and emailed it out, but people running IE are unable to use the buttons, they simply do nothing.Here is the .js file, I don't think anything in the HTML or CSS is causing the issue but could post those as well if necessary.

var step = 1;
//preload images
var numImages = 13;

[code]....

View 2 Replies View Related

Code Works With Alert() But Not Without?

Nov 23, 2009

function Search( name, category )
{
var sresults = [];
var sri = 0;
if( category != "Any" )

[Code]...

This is probably the weirdest thing I've ever seen. I know the code works since Firefox will output things, but it ONLY outputs when I throw in an alert statement somewhere in the function that gets called. It doesn't matter if it's at the beginning and just says Hi, but then it will run correctly. Without it, Firefox won't go through the function apparently and won't write out the results. I don't understand why this isn't working or why firefox is doing this.

View 1 Replies View Related

Code Works In Firefox Not In IE

Feb 9, 2010

I've inherited a page that enters data into a database, some of the fields are calculated and one uses today's date. In Firefox it all works fine but in IE it wont load the full page.

View 2 Replies View Related

AJAX Code Works In FF But NOT In IE8?

May 25, 2010

Ive been sitting with my cod for a while now and dont see what to change..

Im fetching data to a div in the page from n Server side ASP page.

Its all working in Firefox browser but not all runs in IE.

Code:

function displayLocation()
{
var Results;
if (xhr.readyState == 4) {

[Code]....

I added an Alert as you will see so i could see in IE if the responseText data was getting there and it seems to be fine, it just wont display the data in this line...

Code:
window.document.getElementById("Span1").innerHTML = Results;

View 4 Replies View Related

Ajax :: Code Works Only Once In IE6/7?

Oct 19, 2010

I'm attempting to learn Ajax and the simple test program I wrote works great in all major browsers (IE8, FireFox, Opera, Chrome, etc).The javascript calls a tiny perl program to replace what is in the <div> area with a random number.The problem I'm having is the code does work in IE6 and IE7, but unlike the other browsers you can only click on the link to activate the AJAX function one time. After the second or more clicks it will not provide a new random number like it does in the other browsers.The only way I found to get a new random number in IE6/7 is to first clear my temporary internet files. The I get one more click and it provides a new random number but stops again until I re-delete my temporary internet files.The test program is located here:

http:[url]....Here is the complete code:

Code:
<html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<HEAD><META HTTP-EQUIV="Pragma" CONTENT="no-cache">[code]..........

View 3 Replies View Related

Code Works In IE But Not In Firefox?

May 28, 2010

<HTML>
<HEAD>
<TITLE> MEA </TITLE>

[code].....

View 1 Replies View Related

Code Works In IE But Not Firefox?

Oct 26, 2010

I have the following code that I modified from an online article that works great in internet explorer but not in Mozilla Firefox.

Code:
<script language="JavaScript">
var NS4 = (document.layers);

[code].....

View 3 Replies View Related

JQuery :: Same Code Works On One Page But Not Another?

Jan 9, 2012

I am using jquery to popupa calendar. I have done this on several pages with not problems this one page keeps claiming the error below. Message: Object doesn't support this property or method

[Code]...

View 5 Replies View Related

JQuery :: Code Works On One Server, Not On The Other?

Apr 27, 2011

I am using a jQuery script to create charts called Highslide. I posted for help on their forum but they are a little slow, and this issue is really regarding a javascript error, I believe.

This issue happensoccasionallyin Internet Explorer 8, where the chart wont appear at all and throws an error. If you refresh the page again, it will display the chart fine. Ive been through this code and can not find what the problem is. what is odd, is if i put the code up on another server it works the first time.

View 1 Replies View Related

Code That Works Across All Browsers And Platforms?

Sep 7, 2009

I am trying to set up some code to control a mouseover popup image. I have the script that works except in certain browsers the results are different.This is the page: (just mouse over the first players name).Here is the script:

<script type="text/javascript">
function ShowPopup(hoveritem)
{

[code]....

View 6 Replies View Related

Only Half Validates, Otherwise Code Works Well?

Mar 25, 2011

I am having trouble getting my code to validate for my speed/distance calculator.I have 2 input prompts: 1 for hours and 1 for minutes. The issue is I can put a number for hours (e.g 7) and W for minutes and the result will display distance is NaN, whereas I am expecting it to alert user to input a valid number. The same issue applies if I switch the order of isNan(hours) and isNaN(mins)

[code]....

View 3 Replies View Related







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