Prototype.__defineGetter__() Equivalent In Konqueror

Jul 20, 2005

Is there an equivalent in Konqueror's KJS engine to Gecko's
__defineGetter__() and __defineSetter__() methods? Our web application
uses a ton of Javascript, written based on Internet Explorer's object
model as that's the primary platform that we're supporting. For
Netscape support we uses __defineGetter__() and __defineSetter__() to
emulate the many IE-only properties. I've tested our site using
Safari, and to my surprise, it renders perfectly. Alas, it's
completely non-functional. If it's somehow possible, I'd love to write
a similar emulation library for KJS so that our non-Windows users
would have an alternative to crummy Netscape/Mozilla.

View 1 Replies


ADVERTISEMENT

JQuery :: Equivalent Of Prototype Function.bind?

Jan 5, 2010

Is there a jQuery way of doing this Prototype bind?

var func = myFunction;
setTimeout
func.bind
this
, 1000
;

View 2 Replies View Related

Relative References With Konqueror?

Jul 20, 2005

I discover a strange bug in Konqueror 3.1.1.
I design a javascript application which acts in one file called
example.html. At the beggining of this js i write:

if (document.images)
{
folderopen= new Image(16,16);
folderopen.src="http://www.sergioamo.8m.com/buttons/folder_open.png";
folderclose= new Image(16,16);
folderclose.src="http://www.sergioamo.8m.com/buttons/folder_close.png";
}
functions....
....
...
..
and my javascript works perfect.
If i write:

if (document.images)
{
folderopen= new Image(16,16);
folderopen.src="./buttons/folder_open.png";
folderclose= new Image(16,16);
folderclose.src="./buttons/folder_close.png";
}
functions...
....
...
..
my javascript does not work properly. Does anyone knows if is imposible
to use relative references with konqueror 3.1.1 or which is the problem?

View 2 Replies View Related

Konqueror And Opera Problems

Dec 16, 2006

I am creating a chat script that uses PHP and Javascript. For part of it I need to empty one of the text boxes. The scripts I use work fine in IE and Firefox, however the the text box will not clear in Opera and Konqueror. I have tried the follwoing:
document.getElementById('commentbox').innerHTML = ''
and
document.chatform.comment.value = "";

Like I said they are both fine in IE and Firefox, but not in Konqueror or Opera. I have searched for hours looking for code that will work.

View 3 Replies View Related

Onclick Image Coordinates From Konqueror And Safari

Sep 26, 2005

I am trying to capture the image coordinates when a user clicks on an
image. My code is working in Firefox, Mozilla, Netscape, IE, and
Opera, but fails under Konqueror (and I suspect Safari). The code below
fails in Konqueror when the page is scrolled down; the coordinates are
off by the scroll amount.

My code in the html img tag: onClick="MLDot(event)"

and the related statements in the MLDot function:

xPosition =
event.offsetX?(event.offsetX):event.pageX-document.getElementById("clickImage").offsetLeft;
yPosition =
event.offsetY?(event.offsetY):event.pageY-document.getElementById("clickImage").offsetTop;

Anyone know how to pick up image coordinates in Konqueror/Safari?

View 1 Replies View Related

Konqueror/Safari Problem: DHTML-generated Links And Frames

Sep 26, 2006

I have a Web page with two frames.

The left frame has a DHTML-generated tree of links (to images). The
right frame displays the image link you click in the tree of links.

It works great on all browsers except Konqueror/Safari, where it
displays the first image link you click on in the tree of links. But
then subsequent clicks on other links do nothing.

That is, the first time you click on a DHTML-generated link,
Konqueror/Safari loads the corresponding image in the other frame.
However, after that, when you click on links, the other frame is not
updated.

Do you know why this happens?

View 1 Replies View Related

Difference Between Object.prototype And Function.prototype?

Nov 25, 2011

According to ECMAScript, the root of the prototype chain is Object.Prototype. Each object has an internal property [[Prototype]] that could be another object or NULL.... However, it also says that every function has the Function prototype object: Function.Prototype, it confused me, because a function is an object, for a function object, what is its function prototype and object prototype..For example:

var x = function (n) {return n+1;};

what is the relationships of x, Object.Prototype and Function.Prototype

View 5 Replies View Related

How Come Object.prototype Inherits From Function.prototype

Dec 14, 2009

I am trying to get to the bottom of javascript object, prototypes etc. I have a fairly good grasp of it, but I get confused the closer I get to the base object.prototype. FIrst of all, I was under the impression that all objects descend directly from Object. But some objects (like Array) seem to inherit properties and methods from the function.prototype. So does this mean that the chain is like this:

object -- function -- array Second, I noticed (on the mozilla javascript reference site that object.prototype inherits properties and methods from function.prototype and vice versa!? How can this be? I must be missing something important about understanding the chain?

View 24 Replies View Related

Multithreading? Or The Equivalent?

Jul 23, 2005

Is there a way to achieve multithreading in JavaScript? I'm looking to
fetch a page into a div while allowing the user to interact with another
div. At some point the newly fetched page contents will be available to the
div that the user is working in but I don't want to cause unnecessary
blocking. I've thought of using frames (would prefer divs) plus timeouts
and checking for when a load completes. Does anyone have an idea of how
this could work?

View 8 Replies View Related

Non IE Equivalent To IE's Data

Jan 12, 2006

A friend of mine has built as simple site for use on his company's
intranet. It uses JavaScript to read comma-delimited information from a
text file and displays it in tabular form.

When I looked at the source there is js like this:

function forwardClick() {
if (sitelist.recordset.AbsolutePosition !=
sitelist.recordset.RecordCount) {
sitelist.recordset.moveNext();
} else {
alert("You are already at the last record in the database.");
}}

and HTML like this:

<OBJECT id="sitelist"
classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83" border="0"
width="0" height="0">
<PARAM name="DataURL" value="sites.txt">
<PARAM name="UseHeader" value="True">
</OBJECT>

Obviously it's a Windows and IE only thing but is there an equivalent
for non-IE browsers and/or non-Windows OS?

View 2 Replies View Related

Va_list Equivalent

May 7, 2006

wondering if there is a va_list equivalent in Javascript. Well,
actually, I know that there is, but I don't know if its user...
applicable. va_list in C/++ anyhow is a way of being able to pass in
any number of arguments at the end of a function, I'll show an example:

Code: ( text )
Header:void addLine(int, const char*, ...); cpp:addLine(int line, const char *string, ...) {char *output;va_list args;va_start(args, string);vasprintf(&output, string, args);va_end(args);}

So as you can see, the space is reserved at the end of the function
declaration with the "..." syntax, and in the function body is expanded
and processed. I could be way off here, but I think I'm on the right
track.

View 12 Replies View Related

JS Equivalent To PHPs $$?

Mar 10, 2010

I'm trying to find out if javascript has something akin to $$ in php.What I'm trying to do:

var costs = {
cost1: 5,
cost2: 10,
cost3: 15
}

// Retrieve cost user has selected

alert(costs.selectedCost);

Its obviously a hyper-simplified example of what I'm trying to do, but the premise is the same. In PHP, I could use $$ to convert one variable into another, not sure if JS can do the same.

View 6 Replies View Related

PHP Get_file_contents Equivalent?

Jul 8, 2010

I have been trying to figure out how to access files on different servers through javascript, as i am converting an onsite myspace app to an iframe app, i need to get the contents of a file from the last.fm api and store it in a variable. Or maybe i could get it with php and store it in a javascript variable if that is possible,

View 3 Replies View Related

Nl2br Equivalent

Nov 6, 2003

Is there a javascript equivalent of PHP's nl2br() function? I have to send the value of a textarea to a new window that will display the text of what was in the box, which is why I need to somehow convert newlines to breaks.

View 9 Replies View Related

Equivalent To Display:none For <option> In IE?

Jul 23, 2005

I've been using display:none on the style property of some <option>
elements in my forms, which works fine with Mozilla - as expected it
removes the option from my dropdown (although it still exists in the
code). Is there an equivalent in IE?

The reasoning behind this is that I want users to rank objects using a
<select> for each place (see below), and to remove the choice of earlier
objects from <select> drop-downs later in the list.

1st place: [<Select> with option 2 chosen]
2nd place: [<select> with option 4 chosen]
3rd place: [<select> --> Option 1
Option 3
Option 5
Option n]

View 3 Replies View Related

Is There An Equivalent To CreateObject In JavaScript?

Jul 23, 2005

I want to do some Win32 application automation from JavaScript. Is it
possible? Failing that, is there a way to execute an application from
JavaScript?

View 2 Replies View Related

CGI Parameters (or Equivalent) In Javascript

Jul 20, 2005

Does anyone know a way of passing parameters into a Javascript script 'from
outside' via additions to the URL -- similar to (or even the same as!) the
idea of CGI parameters?

View 7 Replies View Related

Mozilla Equivalent Of SrcElement?

Apr 6, 2011

Mozilla-equivalent of the following line of code:

document.getElementById('editorContent').contentWindow.event.srcElement.href

The purpose of this line is to get the "href" value of a link when clicked on inside a content-editable iframe.I have the function working perfectly in IE, but not having much luck with Mozilla browsers.

View 9 Replies View Related

Javascript Equivalent For File_get_contents

Aug 14, 2005

Whats the Javascript equivalent for PHP's file_get_contents ?

<script type="text/javascript">
document.open("http://anotherpage.php"); // I know this is not the way because this opens a new page
</script>

Any way without using frames ?

View 3 Replies View Related

Equivalent JavaScript To Run In FireFox

Jul 31, 2007

I have to do drag and drop.Following one is runing well in IE But not in FireFox. Code:

View 1 Replies View Related

Converting Ascii Value Into Its Equivalent Value?

Mar 4, 2010

Give me a sample program for converting Ascii value into its equivalent value.for example get the input as 65(Ascii value of A) and display 'A' as output

View 1 Replies View Related

Find Php Equivalent To Its Unset?

May 12, 2010

I am running through an array and need to unset given values, but i can't seem to find the php equivalent to php's unset?[code]...

View 2 Replies View Related

Javascript Equivalent For Vbscript Date()-1

Mar 28, 2007

I'm looking to return DATE ONLY for yesterday's date. No seconds,
milliseconds. Formatted either yyyy/mm/dd or mm/dd/yyyy. VB does it so
easily Date()-1 will return 03/27/2007 if today is 03/28/2007. Why so
many hoops for javascript? Any ideas?

View 21 Replies View Related

InnerHTML Equivalent Of An Iframe Element?

Apr 22, 2007

Is it possible to get the contents of an iframe (I need a method that
allows me to get the generated HTML code of an XML file that was
transformed by an XSL file)?

View 5 Replies View Related

JQuery :: Getting To The Equivalent Of A GET Form Submit?

Apr 30, 2009

I have a couple of simple forms:

[Code]...

but it doesn't work, because it's not passing the variables correctly I don't think. I don't know how to simulate a simple GET posting of a form.. the data line in this code is from another script which uses POST, but POST doesn't work for my purposes so I have to use GET.

View 1 Replies View Related

JQuery :: 1.4.2 Equivalent Of Find (Element)

Aug 14, 2011

<html><head>
<script src="jquery.js"></script>
<script type="text/javascript">
addIframe = function() {
$('body').append('<iframe>');
} appendIframe = function() {
$('iframe').contents().find('body').append('appended');}
</script>
</head><body>
<button onClick="javascript:addIframe();">addIframe</button>
<button onClick="javascript:appendIframe();">appendIframe</button>
</body></html>
Now this work perfectly fine with jQ 1.6.2, but does not work with 1.4.2 because 1.4.2 does not yet know .find(element).

View 2 Replies View Related







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