473,785 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Alternative to Using Onload Command?

I'm working on integrating the a javascript wysiwyg editor (Xinha) with
my blog software (ExpressionEngi ne, aka EE). EE has extensions now so
it's easy to get the Xinha header code into the head section of the EE
web page.

But Xinha likes to use an onload command to launch:

window.onload = xinha_init;

....and EE is already using the onload command in the body tag of the web
page:

<body onLoad="documen t.forms[0].title.focus(); set_catlink();" >

The onload command in the body tag is keeping the window.onload command
from working. At this point EE doesn't let extensions modify the body
tag.

Is there an alternative way to run the xinha_init command, without using
the window.onload command? Thanks very much to all for any info.
Jan 28 '06 #1
3 2956
Vik Rubenfeld wrote on 28 jan 2006 in comp.lang.javas cript:
The onload command in the body tag is keeping the window.onload command
from working. At this point EE doesn't let extensions modify the body
tag.


=============== =============== ===
<body onload='alert(2 );'>

<script type="text/javascript">
x = document.body.o uterHTML.split( '>')[0].split('=')[1]
window.onload = function(){aler t(1);eval(x)}
alert(0);
</script>
=============== =============== ===

returns alerts: 0 1 2

sorry for the evil eval() and outerHTML is IE only.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 28 '06 #2
On 2006-01-28, Evertjan. <ex************ **@interxnl.net > wrote:
Vik Rubenfeld wrote on 28 jan 2006 in comp.lang.javas cript:
The onload command in the body tag is keeping the window.onload command
from working. At this point EE doesn't let extensions modify the body
tag.


============== =============== ====
<body onload='alert(2 );'>

<script type="text/javascript">
x = document.body.o uterHTML.split( '>')[0].split('=')[1]
window.onload = function(){aler t(1);eval(x)}
alert(0);
</script>
============== =============== ====

returns alerts: 0 1 2

sorry for the evil eval() and outerHTML is IE only.


<body onload='alert(2 );'>

<script type="text/javascript">
x = window.onload;
window.onload = function(){aler t(1);x();}
alert(0);
</script>

works in mozilla
but if you know that the onload function will always be the same (and won't
be anonymous) you can just call it by name.

--

Bye.
Jasen
Jan 29 '06 #3
Jasen Betts wrote on 29 jan 2006 in comp.lang.javas cript:
<body onload='alert(2 );'>

<script type="text/javascript">
x = window.onload;
Nice!! Test this here:

alert(x)

window.onload = function(){aler t(1);x();}
alert(0);
</script>

works in mozilla


Also in ie6

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 29 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2792
by: Henry Ludemann | last post by:
I've been writing an optparse alternative (using getopt) that is at a stage where I'd be interested in people's opinions. It allows you to easily creating command line interfaces to existing functions, using flags (which are optional) and arguments. It will automatically print a nicely formatted usage (eg: -h or --help), and easily & automatically validates parameter existence and type. You can download it, and read a bit more about it,...
7
50899
by: Doug van Vianen | last post by:
I recently found the following JavaScript code which is supposed to let one find then use the ip address of the person accessing the web page containing the script. <SCRIPT LANGUAGE="JavaScript"> <!-- var ip = '<!--#echo var="REMOTE_ADDR"-->'; function ipval() { document.myform.ipadd.value=ip;
2
2875
by: llaxman | last post by:
Hello everyone, I was wondering if anyone can help me? I am having some problems wit the <noscript> tag. I actually use it to block banner advertisements from being displaye in my website. I have used it at the <body> tag section and look something like this: <noscript>
2
9546
by: Rich | last post by:
Is there any way I can check to see if a document is loaded into the iframe before I call onLoad (sort of an afterLoad). I'm loading up a page into an iframe. But because we use four servers which use load balancing, the content isn't specified straight away. Therefore as I'm using onload to resize the iframes scroll bars to the size of the iframe content, I need to wait for this to be loaded first. Is there an alternative to onLoad that...
4
2351
by: David Virgil Hobbs | last post by:
My web host inserts banner ads into my html pages. The javascript in these banner ads interferes with the onload triggered javascript functions in my pages. Whether I trigger my javascript functions through onload=function() in the body tag or through window.onload=function name in a script, the host's advertising javascripts disrupt my javascripts that are supposed to run onload so that they do not run. I am not able to control the...
2
8580
by: Jarson | last post by:
My webserver hosts some on-line reports with live data. I have put an html meta tag to force the client to refresh every 10 minutes so my clients will always show the latest data .. <meta http-equiv="Refresh" content="600" /> However, once or twice every day my IP address changes or my WAN link may be inaccessible for a couple of minutes. If the client refresh occurs during the period that my host is down or DNS entry is updating...
9
22444
by: nntp | last post by:
Is there anyway to do something exactly like onload, but without the word onload? I am trying to write inline js without onload, so I don't know how to trigger/start the script.
4
14338
by: Viken Karaguesian | last post by:
Hello all, I have a question. I trying to run two Javascripts on my webpage, both of which need a <body onload> command. They are as follows: <body onload="runMe()"> <body onload="SwapImgs()"> What would be the proper format to include these on the same line? would it be:
7
2350
by: Spartanicus | last post by:
Afaik the use of a <noscriptelement is frowned upon nowadays. For a JS random image changer I tried to use a replacement by having the script change the HTML src attribute value of an img element. The trouble is that in some situations like over slow connections (on initial load when the JS is in an external file), or with a slow client the image specified in the HTML starts to load and display before it's changed by the script. This I'm...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.