Could i try something with a recursive (?) function that copies with a special copy if the type is an Object and normal copy else?
Does an Array has the same behaviour???
I already thought of this. The only problem is that I hav recursive objects and i want them to be copyed (not reffed) as well. I don't think this will work for my application.
in Mozilla (NS) events are called in a different way. The first parameter of an on... function has the event object, while IE has a (sortof) global event object.
use some what like this:
function fixEvent(evnt)
{
if (typeof(evnt) == "undefined") evnt = window.event;
if (typeof(evnt.layerX)...
Hi all,
Is there a way to make the following script work as i would expect it to?
<script language="javascript">
function constr () {
this.value = 'oldval';
this.someotherval = 'xxx';
}
var obj = new constr ();
obj.someotherval ='yyy';
var obj2 = obj;
obj2.value = 'newval'...
this is what i finally found :)
var x,y;
if (self.innerHeight) // all except Explorer
{
x = self.innerWidth;
y = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
// Explorer 6 Strict Mode
{
x = document.documentElement.clientWidth;
y =...
How do i find out the available width and height of a browser window. I checked out some docs and it said window.innerHeight and window.innerWidth. But:
when i do
alert (window.innerHeight); using IE 6.0 it says 'undefined' while using Mozilla 1.6 it gives me a reasonable 698...
i also checked...
Hi all,
Does anyone know a good way to 'log' javascript activity.
Preferably to a file, but something like a separate window or something is just fine.
I have 2 pieces of html:
<body>
<form style="border: 1px solid gray;">
<br>
<br>
some text 1<br><br>
</form>
some text 2
</body>
the other one
<body>
<form style="border: 1px solid gray;">
<br>
<br>
some text 1<br>
</form>
some text 2
</body>
Obviously the difference is...
I knew i was right, this means i have to rearrange my whole structure :(
My tables don't know how much cols there are gonna be, and if i don't know that i can't create the td's before i fill them. The major downside to this is that i'll want a colspan somewhere along some tr, and that's not...
view the following simple script:
<body>
<table border=1>
<tr id='row'>
</tr>
</table>
<script language="JavaScript">
<!--
document.getElementById('row').innerHTML = '<td>hello world</td>';
//-->
</script>
</body>
This should display 'hello world' with a border around it.
Mozilla...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.