473,566 Members | 3,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Issues with IE & Prototype/AJAX

The following code works great in FireFox, Opera, Netscape, Safari, and
Gecko, but NOT IE. Why?

I tried using 'native' js with setInterval and setTimeout, but I get
the same result. My IE security settings are not an issue.

Anyone have any insight on this?

Thanks!
-sh
*************** *************** *************** *************** *****
// JavaScript Document
var ud1 = new PeriodicalExecu ter(getIncremen ter, 5);
var ud2 = new PeriodicalExecu ter(getMicrotim e, 5);

function getIncrementer( )
{
var url = 'filter.htm';
var myAjax = new Ajax.Request( url, { method: 'get', onComplete:
showMyData });
}

function getMicrotime()
{
var url = 'filter2.htm';
var myAjax2 = new Ajax.Request( url, { method: 'get', onComplete:
showMicrotime });
}

function showMyData(req)
{
//put returned Text/XML in the textarea
$('my_div').inn erHTML = req.responseTex t;
}

function showMicrotime(r eq)
{
//put returned Text/XML in the textarea
$('microtime_di v').innerHTML = req.responseTex t;
}

Aug 2 '06 #1
17 3132

Steve-O wrote:
The following code works great in FireFox, Opera, Netscape, Safari, and
Gecko, but NOT IE. Why?
For some udisclosed value of 'works' and 'not (works)'.

I tried using 'native' js with setInterval and setTimeout, but I get
the same result. My IE security settings are not an issue.
prototype.js is about 1,800 lines of code and you give no hints as to
where the error might be. Post the 'native' js version and you might
get an answer - or ask in a prototype.js news group or forum.

[...]
--
Rob

Aug 3 '06 #2
Steve-O wrote:
The following code works great in FireFox, Opera, Netscape, Safari, and
Gecko, but NOT IE. Why?

I tried using 'native' js with setInterval and setTimeout, but I get
the same result. My IE security settings are not an issue.

Anyone have any insight on this?

Thanks!
-sh
*************** *************** *************** *************** *****
// JavaScript Document
var ud1 = new PeriodicalExecu ter(getIncremen ter, 5);
var ud2 = new PeriodicalExecu ter(getMicrotim e, 5);

function getIncrementer( )
{
var url = 'filter.htm';
var myAjax = new Ajax.Request( url, { method: 'get', onComplete:
showMyData });
}

function getMicrotime()
{
var url = 'filter2.htm';
var myAjax2 = new Ajax.Request( url, { method: 'get', onComplete:
showMicrotime });
}

function showMyData(req)
{
//put returned Text/XML in the textarea
$('my_div').inn erHTML = req.responseTex t;
}

function showMicrotime(r eq)
{
//put returned Text/XML in the textarea
$('microtime_di v').innerHTML = req.responseTex t;
}
setTimeout sometimes catches me because I forget that they are separate
threads and that they only run once. If you want to make a sort of
do-events style for-loop type structure using setTimeout instead, you
need two functions.

The first starts it going, eg:
<scriptsetTimeo ut(code, time); </script>

the second has to decide whether to set it going again:
<script>
DoStuff()
if (keepgoing) setTimeout(code , time);
</script>

careful that you keep track of if the loops is current executing, eg
with a global variable or something more refined. Else someone might
start the timer twice and you'll get two loops that each spawn two new
ones when they finish. Generally doubles the framerate of whatever you
are updating, but not in a good way.

hth

http://darwinist.googlepages.com/htmldesktop.html

Aug 3 '06 #3
da*******@gmail .com wrote:
<snip>
... I forget that they are separate threads ...
You should as javascript is not multithreaded, so they are _not_
separate threads.

Richard.
Aug 3 '06 #4
Ray

Richard Cornford wrote:
da*******@gmail .com wrote:
<snip>
... I forget that they are separate threads ...

You should as javascript is not multithreaded, so they are _not_
separate threads.
When you send an AJAX request using Prototype, isn't it done using a
separate thread? I know what you mean about JS (the language) being not
multithreaded though.
>
Richard.
Aug 3 '06 #5
Ray wrote:
Richard Cornford wrote:
>da*******@gmail .com wrote:
<snip>
>>... I forget that they are separate threads ...

You should as javascript is not multithreaded, so they are _not_
separate threads.

When you send an AJAX request using Prototype, isn't it done using a
separate thread?
I would never use Protoytpe.js, I know javascript. The XML HTTP request
objects (at least when making asynchronous requests) must be operating
in what is effectively a separate thread (but they are likely written
in C++). The handling of the response by javascript is not
multithreaded; no executing javascript in the same environment will be
interrupted by/overlap with the response from and XML HTTP request
object and the handling of that response will not be interrupted
by/overlap with event handling code or setTimeout/Interval triggered
code (the latter must wait until the handling of the XML HTTP response
comes to an end).
I know what you mean about JS (the language) being not
multithreaded though.
Good, VK is likely to try to make out the javascript is multithreaded
(at least he has often done so in the past) but nobody else is that
foolish.

Richard.

Aug 3 '06 #6
Ray
Richard Cornford wrote:
<snip>
The handling of the response by javascript is not
multithreaded; no executing javascript in the same environment will be
interrupted by/overlap with the response from and XML HTTP request
object and the handling of that response will not be interrupted
by/overlap with event handling code or setTimeout/Interval triggered
code (the latter must wait until the handling of the XML HTTP response
comes to an end).
Ah, I didn't know this part. Thanks! That's good to know.

<snip>

Aug 3 '06 #7
Ray
Richard Cornford wrote:
I would never use Protoytpe.js, I know javascript. <snip>
What's wrong with Prototype? What do you think of other libraries like
Dojo toolkit or X ?

Thanks,
Ray
Richard.
Aug 3 '06 #8
On 03/08/2006 12:05, Ray wrote:
Richard Cornford wrote:
>I would never use Protoytpe.js, I know javascript. <snip>

What's wrong with Prototype?
There has been at least one thread dedicated to criticism of the
Prototype library[1]. Feel free to browse the archives[2]. :-)
What do you think of other libraries like Dojo toolkit or X ?
I'm not trying to speak for Richard, but his answer is highly likely to
be negative; he dislikes monolithic libraries, as do some other regulars
in this group. You will quickly realise that from browsing the
archives[3]. Perhaps he has specific criticism, though.

I've never used any of them, myself, and only glanced at Prototype long
enough to dislike it.

Mike
[1] prototype.js criticism 2006-03-20 07:26:45 GMT
<11************ *********@g10g2 000cwb.googlegr oups.com>
<http://groups.google.c o.uk/group/comp.lang.javas cript/browse_thread/thread/b699522a97d26a6 d/5d5110a25cd79c2 e?lnk=st&q=&rnu m=2&hl=en#5d511 0a25cd79c2e>

[2] Google Groups search results for:
group:comp.lang .javascript prototype library wrong | bad | evil
<http://groups.google.c o.uk/groups?lnk=hpsg &hl=en&q=group% 3Acomp.lang.jav ascript+prototy pe+library+wron g+%7C+bad+%7C+e vil>

[3] Google Groups search results for:
group:comp.lang .javascript author:"Richard Cornford" libraries
<http://groups.google.c o.uk/groups/search?hl=en&q= group%3Acomp.la ng.javascript+a uthor%3A%22Rich ard+Cornford%22 +libraries&qt_s =Search>
Aug 3 '06 #9
Ray

Michael Winter wrote:
On 03/08/2006 12:05, Ray wrote:
Richard Cornford wrote:
>
I would never use Protoytpe.js, I know javascript. <snip>
What's wrong with Prototype?

There has been at least one thread dedicated to criticism of the
Prototype library[1]. Feel free to browse the archives[2]. :-)
<snip>

Thanks Michael!! That's going to be educational for me :)

Cheers
Ray

Aug 3 '06 #10

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

Similar topics

4
9544
by: k.mitz | last post by:
Hi, I have a PHP application that allows users to generate a .pdf report of their database content. Normally, I've had to refresh a page to call the script to generate the report, so there's a second or so when the browser goes blank. I was wondering if it was possible to use AJAX to call the script to generate the report, then begin the...
3
1661
by: morganwhitney | last post by:
Hi all, I am developing a web app and I am implementing the JavaScript using the Prototype Framework. I have done all the same stuff from scratch in a previous application and it worked fine, but I am having a couple of issues when trying to use Prototype. 1. Parameters are not sent if I specify a transport method: var url =...
10
6296
by: Steve | last post by:
I need to build a very dynamic client and would be interested in knowing the pros and cons of using JSF and Ajax to accomplish this. Thanks. Steve
1
1831
by: vachacz | last post by:
hi i'm struggling with integration of a js class aimed for ajax handling with fireing actions from the class. here's my code sample: function AjaxLibLoad(httpActionParam, targetLayerParam){ this.targetLayer = targetLayerParam; this.httpAction = httpActionParam; this.httpRequest = this.httpRequestInstance(); this.load(); };
5
20055
by: dougwig | last post by:
I'm trying to handle the scenario where a user's session times out and and their ajax request triggers a redirection by the webserver (302 error?). I'm using Prototype 1.4 and the my works great with Firefox,but with IE6 the onFailure never gets called and the request never completes. My code: var ajaxReq = new Ajax.Request( url,...
7
1806
by: BeeRich | last post by:
Hi folks. I built an ajax.updater reply in a website on a Mac, and she works fine. It's a simple reply, the html supplied is correct, and I also supply the target DIV as well. Just wondering why a PC won't show anything. Cheers
5
4179
by: Gerry Vandermaesen | last post by:
Hi, Does anyone have a freely available JavaScript JSON stringifier. So far my search has been in vain, the one offered on http://www.json.org/json.js does not seem to work for me.
23
1750
by: Dautkhanov | last post by:
Hello ! Does anybody have cutted version of prototype.js with the AJAX functionality only? I am a new in prototype.js topic, so I think this task should be done by other developers. Maybe protorype.js should be splitted into small pieces of the js scripts with groupped functionality
3
3568
by: jacobstr | last post by:
I've noticed Object.extend used in a few different ways and I'm having trouble distinguishing why certain usages apply to a given situation. On line 804 Ajax.Base is defined as follows: Ajax.Base = function() {}; Ajax.Base.prototype = { setOptions: function(options) { <...>
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7893
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. ...
0
8109
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...
0
7953
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...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
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...
1
2085
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
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.