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


ADVERTISEMENT

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

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

Document.write Inside A Document.write?

May 17, 2010

I'm working on a website that will basically embed a widget/frame sent by a handler into a user's current page. The user basically adds a script tag to where they would like the HTML to be. The script tag has their settings and is basically a document.write that calls all the code that we want displayed.So here's my problem. We have a map that we need to add in a specific section, and to get the map we have to call another script tag. So we end up having a script tag (map) embedded in another script tag (the code for the widget/frame) or we end up having to document.write inside a document.write.

Now this works just fine and as expected in Firefox, Safari, and Chrome. However, Internet Explorer and Opera wait until the first document.write is completely finished before calling the embedded one. Of course the problem with this, is that it takes the map out of the document's flow and just appends it to the bottom left of the page. Since the rest of the page has already been called, there's no way to move the interior "map" script.Any ideas? Basically just trying to figure out how (if even possible) to render an embedded script tag in Internet Explorer and be able to place it properly. I've tried everything that I can think of, including AJAX and Google's unescape script.

View 1 Replies View Related

A Tag In Document.write Works In Firefox But Not IE?

Feb 18, 2010

I have a simple javascript on my HTML page that pulls a bunch of images onto the page and adds a URL for a page to view the larger image. When I open the page in Firefox or Safari the image clicks through to the next page just fine. If I open it in IE7, however, clicking on the images does nothing. If I right click on the image and select 'open link' it will go to the page, but it won't just click to it. Does anyone have any ideas what I can do to make this work in IE?here is the code I am using:

Code:
<script type="text/javascript">
var i=1;

[code]....

View 6 Replies View Related

Writing Inside A Div (same As Document.write But In An Existing Div)

Sep 11, 2009

I'd like to do to do something similar as document.write() but instead of creating a new document,I would like to write inisde a div. What I have is a variable with the name of a url that the client has given me from a prompt. And now I want to write that as a link inside the div.

View 10 Replies View Related

Document.write Is Deferred Inside A Table

Sep 15, 2005

My application uses Web pages whose grid is defined by several tables. I noticed a funny behavior on IE and Firefox which is giving me pains.

Apparently, when the browser renders a <table> tag and before it reaches the </table> end tag, any document.write actions in Javascript get deferred execution till closure of table instead of occuring at runtime as they are parsed. Code:

View 2 Replies View Related

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 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

Iframe Resizing Each Time New Page Loads In Iframe

Aug 14, 2009

I'd like to resize an iframe into which different (same domain) pages of differing heights are loaded. I can do a first-time resize no problem. It's the subsequent reloads that need to pass back their height to the parent page There seem to be lots of solutions for that around, but few I can see for resizing each time the iframe reloads. One is described here on another board [URL] but unfortunately the test page is no longer around (or indeed the site), so the full code is no longer available there. This one works, almost, for me: [URL] it does resize for me, but not quite sufficiently high each time - about 90% of what is required: [URL] Is there a way to add on sufficient extra margin that scrollbars no longer appear?

View 8 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

Document.write Into Iframe Changes Charset Of Contained Form To UTF

Jun 2, 2004

I have a window (it's a modal dialog as well, but let's ignore that for now), where I need to write data into an iframe. Dynamically generated data. This data contains a form, this form is then sent to a server process, which expects it to be latin1 (iso-8859-1). It arrives as UTF-8. I have set the charset both in the container html (which contains the iframes) and the iframe in question to latin1, I once toyed with accept-charset of the form as well, all was ignored. So I started to recreate the experiment step by step.

HTML, meta tag text/html charset=iso-8859-1, FORM directly in it --> data is sent as latin1 Next I put the HTML for the form into its own HTML, put an iframe into the first documented and had its src point to the new HTML. Both the new and the old HTML had charset meta tags. Form was loaded into iframe, sent properly as latin1.

I removed both metatags, we're still sending as latin1. Next I thought it might have something to do with the dynamic nature of the iframe filling. I only assigned the iframe's src at runtime. Still, latin1.

Then I took the final step, and instead of reading an html into the src of the iframe, I wrote the code into the iframe with document.write. Everything LOOKED the same, but the server now receives the form data as UTF-8.

For this experiment I am using IE 5.5 (it is our compatibility base, another browser is not an option unfortunately - I'm a straight firefox man at home), and yes, the content has to be written into the iframe dynamically. I cannot create a temp file that I would load into it, or I would much rather not (it's a rather complex performance issue)

To clarify: Soon as I'm using document.write, all meta tags and or accept-charset (or what it was called) for the form are ignored completely.

View 2 Replies View Related

Document.write Output Won't Stay Inside Div / Get Values To Word-wrap When They Get To End Of Container?

Jun 21, 2010

I want to use document.write to output the values of an array. If the array is too long, it totally ignores the width of the container div. How do I get the values to word-wrap when they get to the end of the container?

I've searched on this forum, and also googled for the answer but can't find a solution. I'm still fairly new to Javascript.

View 4 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

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

Automating Text To Change Daily At Specific Time To Website Viewers Time?

Sep 17, 2011

I do pretty much all the computer related tasks, which includes computer system repair, audio/video editing, cd/dvd printing and duplication, document format and creation, etc etc. But when it comes to HTML (or other codes) I know very little. But we needed a website, so I use Homestead hosting and the Homestead (offline) Site Builder program.

Anyway, inside the sight builder program, they have the option to insert HTML Snippets. Which I use for various objects, off site tools, and other. But now I need to do something for which I have not been able to find a "premade" html code object, that can perform the task desired. I have searched and searched google and went through many sites, including this one. I have tried to take some codes which I thought I could alter to make it perform, but they just wouldn't work for what I needed them to do.

I need a code that will automate a "specific text message" to change daily, and to schedule a "different specific text message" to appear each day. I need to be able to schedule each days "texts" at the very least 31 days in advance. In other words, I need to make an array (I think that's what it is called) for the entire month:

Day 1 "today's text 1"
Day 2 "today's text 2"
Day 3 "today's text 3"

[code]....

If were possible to make an "array" that would go six months out (or more) that would be very helpful! But the longest that I have seen is one month at a time, so that may be as long as they go, but I'm not sure.On top of all of this, I need these changes to be performed at a specific time of the day. I would like them to be preformed at sunset everyday, but I don't think there is anyway to direct the code to look at like [URL] sunset times or such. So if I can at least choose a specific hour, like 8:00 pm, that will work, I will just have to adjust this every once in a while.

However, I don't want it to change just at 8:00pm in my timezone. I need it to change at 8:00pm according to the website viewers timezone. Is there a way to make the code "look" at the users computer and "get their time" and use that to adjust what text is displayed? In other words, I live in Indiana USA. If someone in Australia looked up the webpage on the 15th day of the month, but it was 9:00pm Their Time. The text I need to be displayed should be for "Day 16" from the array.

View 13 Replies View Related

Populate Select Boxes - Create Events, With A Start Time And An End Time?

Jun 3, 2009

I'd like some direction on creating a small piece of Javascript that will populate my <select> boxes.Basically, I have a form for users to create events, with a start time and an end time. (These are the two select boxes).For example:

Code:
<select id="startTime">
<option value="12:00AM">12:00AM</option>
<option value="12:15AM">12:15AM</option>
etc.....
</select>

What I am trying to do is:

1) Have times populated in 15 minute incrementals from 12:00AM to 11:45PM

2) Have some type of "error checking" available to where the End Time must be after the start time. It would be nice for the script to automatically change the end time field to a time that is after the start time.

View 11 Replies View Related

JQuery :: Application With PHP - Ajax Doesn't Work Time To Time ?

Apr 21, 2011

I'm writing an application with PHP that let me have statitics about visited pages for my web site. to save informations needed i use an ajax query with the unload event. The problem that i have is titme to time the script uses with that ajax query doesn't work especially when i stay long time in a page.

This is my code?

Why it works most of time but sometime doesn t work? is there any specifications to take for the unload event ?

View 11 Replies View Related

Check The User Enter Time With Current System Time

Mar 2, 2011

I am trying to check the user enter time with current system. If user enter the time less than the current system time then I want to display the alert box. But the code is not working. Here is the code

<html>
<head>
<title>test</title>
<script type="text/javascript">
var d = new Date();
var curr_hour = d.getHours();
var curr_min = d.getMinutes();
[Code].....

View 11 Replies View Related

JQuery :: Document.ready Not Working The 1st Time In IE?

Apr 8, 2010

I use the document.ready function by jquery to trigger some action in an asp page. the problem is that IE has problems the first time the page is loaded. I register the window.resize event for example to do the same actions i do once after first load to keep some alignments correct. these will work in ie but not the initial alignings. I played around with the position of the javascript already and tried everything from having it in the header as well as putting as last element right before </body>.

View 3 Replies View Related

Library - Add Time Controller To Html Document

Apr 28, 2011

I made a javascript library "timelink.js" [URL] It allows you to add time controller to html document. This is a prototype that is trying to solve time-related problems of html such as forgetting taking rid of late information. Hope you use this library.

[Code]....

View 2 Replies View Related







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