By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,589 Members | 1,087 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,589 IT Pros & Developers. It's quick & easy.

prototype and activex?

P: n/a
Hi all

Im trying to use prototype for an xmlhttprequest, but it doesn't seem
to be working cross-browser. Is there someway of getting it to be IE6
compatible (active x)?

here's my code so far, because of the level of abstraction, i guess i
would need to edit the prototype.js file?

<script type="text/javascript" src="includes/javascript/prototype.js">
</script>

function getAssociateData() {

new Ajax.Updater("results", "index.php", {
asynchronous: true,
method: "get",
parameters: "",
//onFailure:
});

}

Feb 10 '07 #1
Share this Question
Share on Google+
6 Replies

P: n/a
libsfan01 wrote:
Im trying to use prototype
Javascript is a language that uses prototype based inheritance, in which
functions have - prototype - properties which refer to objects that will
be used as the base of a prototype chain for objects constructed with
those functions, and is employed in resolving property name on those
constructed objects. If you speak of using "prototype" in the context of
javascript it is these aspects of the language that you will initially be
assumed to be referring to. If you want to talk about an unwisely named
third party product then you should qualify its lable.
for an xmlhttprequest, but it doesn't seem
to be working cross-browser.
As Prototype.js is not ECMAScript compliant it should not be expected to
work in any modern browser, and so not be expected to work cross-browser
(but it was never designed to be cross-browser anyway).
Is there someway of getting it to be IE6
compatible (active x)?
IE 6 is one of the few browsers where the script environment has been
observed to comply with Protoype.js's expectations of its environment. So
it (prototype.js) should 'work' in IE 6.
here's my code so far, because of the level of abstraction,
i guess i would need to edit the prototype.js file?
The Prototype.js code is so convoluted and interdependent that I would be
reluctant to attempt to modify it. XML HTTP requests are very simple
things in themselves, and examples of code that employs them directly is
readily available.
<script type="text/javascript" src="includes/javascript/prototype.js">
</script>

function getAssociateData() {

new Ajax.Updater("results", "index.php", {
asynchronous: true,
method: "get",
parameters: "",
^
The contents of an object literal may not end with a comma, that is a
syntax error. Any browser that does not disregard that syntax error
(which should be all, but will probably just be most) will never execute
this code.
//onFailure:
});
Richard.

Feb 10 '07 #2

P: n/a
libsfan01 wrote:
>
Im trying to use prototype for an xmlhttprequest, but it doesn't seem
to be working cross-browser. Is there someway of getting it to be IE6
compatible (active x)?
Problem 1: "prototype.js" is far from cross-browser capable in itself.
Problem 2: "activex" is not and will *never* be cross-browser capable.

In the first problem, you have to rely on the dreadful implementation
of prototype handling by the included code. It should be fine in IE6,
but not, I suspect, in many other browsers (quite possibly including
even IE7 - does anyone know if it works with the new IE browser?)

In the second problem though, you are *specifically* making the code
non-compatible by using ActiveX - since that is *specifically* a
Microsoft Windows code capability. It is not and can never be
cross-browser capable since cross-browser capability requires that it
does not use any proprietary and restricted code types such as ActiveX.
Feb 19 '07 #3

P: n/a
The Magpie said the following on 2/19/2007 1:46 PM:
libsfan01 wrote:
>Im trying to use prototype for an xmlhttprequest, but it doesn't seem
to be working cross-browser. Is there someway of getting it to be IE6
compatible (active x)?
Problem 1: "prototype.js" is far from cross-browser capable in itself.
Not the problem.
Problem 2: "activex" is not and will *never* be cross-browser capable.
Nobody said any different. But it still isn't the problem.

Be wary of saying never though. They said document.all would "never be
cross-browser"..........
In the first problem, you have to rely on the dreadful implementation
of prototype handling by the included code. It should be fine in IE6,
but not, I suspect, in many other browsers (quite possibly including
even IE7 - does anyone know if it works with the new IE browser?)
Define "works".
In the second problem though, you are *specifically* making the code
non-compatible by using ActiveX - since that is *specifically* a
Microsoft Windows code capability.
He didn't ask about relying on ActiveX. The question was why the code
didn't work. And the problem with the code was a comma.
It is not and can never be cross-browser capable since cross-browser
capability requires that it does not use any proprietary and restricted
code types such as ActiveX.
Are you saying that any code that uses an ActiveX component can never be
cross-browser? I say you are totally wrong about that. If the ActiveX
path is the only path, then no it isn't cross-browser. But, it is quite
simple to write a "cross-browser" AJAX app that uses an ActiveX
component when there is not native HTTPRequest object and the ActiveX is
available.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 20 '07 #4

P: n/a
Randy Webb wrote:
>
I may have missed the OP that stated the specific problem and was
responding only to the quoted text in my reply.
>
Are you saying that any code that uses an ActiveX component can never be
cross-browser? I say you are totally wrong about that.
No, I am not saying that. What I am saying is that code which
*depends* on the use of an ActiveX cannot, by definition, be
cross-browser compatible since it specifies what the capabilities of
the browser must be and that specification is proprietary.
Feb 20 '07 #5

P: n/a
The Magpie said the following on 2/20/2007 9:00 AM:
Randy Webb wrote:
I may have missed the OP that stated the specific problem and was
responding only to the quoted text in my reply.
How do you miss a post that you replied directly to?
>Are you saying that any code that uses an ActiveX component can never be
cross-browser? I say you are totally wrong about that.

No, I am not saying that. What I am saying is that code which
*depends* on the use of an ActiveX cannot, by definition, be
cross-browser compatible since it specifies what the capabilities of
the browser must be and that specification is proprietary.
And that is true. But, with regards to "AJAX" (as it is called), it is
*impossible* to write a single branch script that is "cross-browser".
You *must* write a branch for ActiveX and you *must* write a branch that
uses the native Object. Otherwise, it can *never* be "cross-browser".
And even then, you can not write a truly "cross-browser" (multi-browser
yes) AJAX script.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 21 '07 #6

P: n/a
Randy Webb wrote:
>
And that is true. But, with regards to "AJAX" (as it is called), it is
*impossible* to write a single branch script that is "cross-browser".
You *must* write a branch for ActiveX and you *must* write a branch that
uses the native Object. Otherwise, it can *never* be "cross-browser".
And even then, you can not write a truly "cross-browser" (multi-browser
yes) AJAX script.
I absolutely agree that you must. But the branch code can cater for
both cross-browser capability (W3C standards, at least) and whatever
proprietary code branches are needed - which might, at least in
future, not be just Microsoft-dependent.
Feb 22 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.