473,379 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

document.write(), external script and refresh

Little problem:

Using the document.write() function and an enormous string, I have managed to create self-generated pages with functions calling code located in external scripts. The code that generates these pages is linked to these pages from within the document.write() string. So far so good.

I lifted on the internet a supercode (flashobject.js) that detects Flash pluggin and loads Flash movies in id'ed <div> only in browsers equipped with Flash Player. Graceful and light. Linked to the self-generated pages as external script file, the code allows for some smart banners. So far so good.

Problem is: The flashobject.js works fine on first load. However, when the page rewrites itself (through the document.write() method), the browser doesn't link the function (embedded just before closing </body> tag) to the external script file (flashobject.js). Funny thing is: when you hit 'Refresh' on the toolbar, the flashobject function DOES work. It's only upon document.write() that the script won't happen.

Would like to have a line a code to insert somewhere so that the browser understands that there has been a 'rewrite' of the page and it's time to load the flashobject.js again... Any idea? The problem might be with the flashobject.js file itself... If you feel charitable and patient, here are the links to both external js. MANY MANY THANKS! Cheers!

Nico
www.pseudomagazine.com

Flashobject.js : www.modern-image.co.uk/flashobject.js
Document.write() megastring : www.modern-image.co.uk/script_opium.js
Aug 3 '06 #1
1 8097
Semmel
1
Hi Nico,

I guess your problem is related to mine. I found that if the external javascript contains further document.write() calls, they get delayed after the page has finished loading. Therefore the output of those document.write() calls gets attached to page's end (IE) or onto a new page (Firefox).

See the discussion at WebDeveloper.com .

Semmel
Aug 25 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Geoff Wilkins | last post by:
I am using <SCRIPT src=...> to import a Javascript routine from a remote source. I am then using some of the variables given values in the routine, in my own Javascript.. Unfortunately the...
2
by: Brian | last post by:
Hi all. I have a bunch of pages that reference an external script from the head section. I'd like to add additional <script> elements to the pages' bodies, but I can't edit the pages...
4
by: Prowler | last post by:
In the application we are currently building, we need to write positioning code on-the-fly, based upon the screen offset of the element in the AS/400 application which drives the Web app. The 400,...
2
by: robert.waters | last post by:
Hello, I am dynamically editing the contents of a page and using document.write() to reload the new, edited content. However, on the new page, any calls to functions located in external .js...
6
by: john.lum | last post by:
I am using document.write in an external javascript file to display some content, but I've found that I can't rely on that content being displayed in the location I expect. Here's a very simple...
11
by: Michael Powe | last post by:
How can I make an XHTML-compliant form of an expression in this format: document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>"); this turns out to be a...
9
by: sonnystarks | last post by:
I am taking a course in writing javascript and it (and all the books I have been reading) tell me that if I will use the document.write syntax, I will be able to "place text on the page." None...
31
by: Manfred Kooistra | last post by:
If I have a document like this: <html> <head> <script language=javascript> window.location.href='file.php'; </script> </head> <body> body content
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.