XMLHTTPRequest Streaming Data

Jul 23, 2005

I am playing with the XMLHTTPRequest method to perform client/server
transactions. I have it set up right now so that when readyState is 4,
it takes the XML and processes it. This works great until there is alot
of data. In that case, the user will have to wait for the data to come
back which may take a minute or so.

I don't want the user to have to wait. Is it possible for javascript to
periodically (while still receiving more data) stop and display what it
has received thus far? I guess this would be considered a type of
streaming.

In mozilla/firefox, I have read that I can use readyState 3 to run my
callback function every 4096 bytes. I can then take those 4K, parse
them, and then continue on. However I have also read that IE cannot do
this. Since I need this to work in IE, is there a workaround?

View 22 Replies


ADVERTISEMENT

How To Read The Streaming Data From IE Xmlhttprequest Object

Apr 3, 2006

I am going to use the server push

for streaming the data by keeping the connection open. At client side,
i am having the XMhttprequest object (i.e ActiveX object of IE). When
the data comes, onreadystatechange method get callback on state 3 but
it doesn't allow me to read the data from the object. It says 'The data

necessary to complete this operation is not yet available'. Is it
possible to read the streaming data from the XMLHttprequest object in
IE?

I know Mozilla supports to read the data, when the ready state is 3. In

Internet Explorer, how we can use the XMLhttp Active object to read the

streaming data.

View 3 Replies View Related

How To Read Streaming Data

Sep 12, 2011

I wants to access server web page which data is continuously growing(streaming data), I want to buffered some of that data write it in responseText then again get next buffered data write it and so on (in AJAX).

View 3 Replies View Related

POST Data With XMLHttpRequest To CGI (Mozilla)

Jul 23, 2005

My JavaScript is trying to POST data to a CGI script (Perl) using
XMLHttpRequest. My CGI server gets different data from IE than Mozilla
Firefox.

// For Mozilla, req = new XMLHttpRequest();
// For IE req = new ActiveXObject("Microsoft.XMLHTTP");
req.onreadystatechange = requestHandler ; // function to handle async
response
req.open('POST', myURL, true); // use POST
req.send('foo=11&bar=22') ;

A Perl CGI script prints the parameters passed to it.
$q = new CGI ;
foreach my $param ($q->param) {
print "$param: " . $q->param($param) . "
" ;
}

The data received by the CGI script is inconsistent, depending if the client
is IE or Mozilla (Firefox)
Server result from IE client:
foo: 11
bar: 22
Server result from Mozilla Firefox client:
POSTDATA: foo=11&bar=22

It seems that the POST data IE sends is more correct than the Mozilla data.
Is there another way to send the data in Mozilla so the CGI script will give
the same results. I could easily adjust the CGI script, but I think the
problem is at the client.

View 5 Replies View Related

Loading Partial Data With XmlHTTPRequest ?

Oct 14, 2007

I'm working with a pretty large XML file, but I really only need to
display a few things that requires quite a few transforms. I already
limited to the transforms to the data i need to use, but I'd like to
speed things up by loading only the data I need.

I need to mention that this is for a local application that sometimes
will lookup updates on a server, but mostly, it is for local use
(offline)

I can use xmlHTTPrequest for both local or server data access. That
seems to work fine. Now I would like to be able to load only the data
I need.

I hear the Google suggest tool bar uses xmlHTTPrequest to look up a
list of known queries, so I am hoping they lookup "only" the necessary
data as one types. It's kinda what I want to do, but I'm not sure how
that would work, since the "url" parameter should be a destination
file name.

View 2 Replies View Related

Retrieving RSS Data Using XMLHttpRequest Object

May 9, 2010

I am having trouble populating elements from the following Yahoo RSS feed: [URL] I need to show the current weather conditions when a button is clicked. Here is what I have so far.

[Code].....

I need to populate the <h1> and two <p> elements. I know that the copyWeatherData() and getWeatherData() functions are not coded properly.

View 2 Replies View Related

Send Binary Data With IE 7's XmlHttpRequest

Sep 18, 2008

I'm reading the content of a local binary file with the method mentioned here: [URL]

Then I'm getting the data as a string where each character represents the binary value. I have successfully sent that string with Mozilla's XmlHttpRequest's sendAsBinary method, but IE 7's version doesn't have that method...

Using the send method almost works, the only problem is that binary content can be represented as the asciicode 0. This means that the string read by sent is cut off as soon as it is encountered. That means that the part before the first NULL character (asciicode = 0) is successfully sent to the server.

The solution I have made right now is to increment each character's asciicode on the client side by one and decrement them on the server before converting the character to the binary representation. The downside with this is that the size of the data sent between the client and server gets larger than the original filesize. Ex: 8kb file grows to ~12kb.

View 1 Replies View Related

AJAX :: Read Data From Server Using XMLHttpRequest.responseText?

Mar 20, 2009

I am trying to read data from server using AJAX XMLHttpRequest.responseText.In received data, there are lot of similar type of characters which has tge value of FFFFFD (65533). I think, all characters which has the value above 127 are converted to default character.

View 1 Replies View Related

Streaming M3u's...

Jul 23, 2005

I have a streaming audio feature set up using a M3u file and a bunch of
MP3's: http://www.motorcityrock.com/mcr_radio/mcr_radio.html. When then
visitor clicks on the link the M3u kicks in and the songs play in the
pre-determined order. That works great, but everytime a visitor clicks the
link the songs start from the beginning. Is there a simple way (using
Javascript or?) to keep the M3u "running" in the background all the time so
that all visitors will hear the same song at the same time...just like a
traditional radio station?

View 1 Replies View Related

Streaming XML With AJAX

Dec 6, 2006

Is it possible to stream XML data from a file using AJAX?
The xml file is constantly being updated by a backend program, I currently have a javascript that has a timer, every second it just runs a loadXML() function to return the XML data however having a few problems with the javascript tripping over itself.

Wondering if AJAX has streaming abilities?

Also, can someone please clarify for me, is the xml dom javascript, or ajax? As I have just read a ajax book that tells you to use xmldom to read xml data but im already doing that, with javascript, what is the difference?

View 7 Replies View Related

Problem With Streaming

Jun 19, 2007

I have just uplaoded my web page and I have having problems playing my files. The entire page works well on the hard drive but dosn't work after I upload it. I assume the problem must be to do with the streaming.

You can view the page to see what I'm trying to do at ....

View 9 Replies View Related

Minimum Bandwidth For Streaming Picture?

Jul 23, 2005

I need to know the min bandwidth for streming picture?

View 1 Replies View Related

Streaming Audio: Change Volume

Mar 19, 2007

I wanna play streaming audio (an asx.file) trough javascript. I allready found a tutorial on the net. Till so far it works (I can push play, pause and stop), but I want to change the volume to. An example: Code:

Do you know where the problem is? One thing that I must say is that the tutorial (where I took it from) worked with a wav-file, as you can see I work with a streaming file (asx-file).

View 2 Replies View Related

Streaming Audio Into Hidden Frame W/ Javascript Controls.

Jul 20, 2005

I want to stream audio into a hidden frame and load, stop, and control
volume via JavaScript. I'm thinking w/ Windows Media Player.

View 2 Replies View Related

Allow User To Download Mp3 Files When They Click On The Link Rather Than Streaming The Audio In The Browser?

Feb 9, 2011

I need to allow user to download mp3 files when they click on the link rather than streaming the audio in the browser. Need to use only Javascript to download the file.

View 1 Replies View Related

Flash Video Streaming With "fall Forward" To HTML5 Video For Mobile Only

Jul 19, 2010

I'm looking to duplicate the video-embedding technique shown on revision5.com, whereby they show the flash video to all platforms where flash is available, and only show the HTML5 player on mobile devices. Is there a browser-sniffing framework, or some other method available to accomplish this?

View 3 Replies View Related

Oo Xmlhttprequest

Mar 13, 2005

Yesterday I started rewriting the xmlhttprequest functions to an oo equivalent, but as it turns out, I don't get it right:

Code:

function Request()
{
this.req=init();
this.req.onreadystatechange = this.processedRequest;
//addEventHandler/attachEvent alternative
//doesn't work either

function init()
{
try
{
if(window.XMLHttpRequest)
return new XMLHttpRequest();
else
return new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
alert(e);
}
}
}

Request.prototype.send=function(url)
{
this.req.open("GET", url, true);
this.req.send(null);
}

Request.prototype.processedRequest=function()
{
if (this.req.readyState == 4)
{
if(this.req.status == 200)
{
response=this.responseXML;
res=response.getElementsByTagName('result')[0].firstChild.data;
func=response.getElementsByTagName('feedTo')[0].firstChild.data;
eval(func+'('+result+')');
}
else
{
alert(this.req.statusText);
}
}
}
expected usage:

Code:

var x=new Request();
x.send(url); //the processing function
//the eventtrigger should activate the callback function
//when the xml has been returned

It seems like the problem is that I don't get to my "this.req" in the processedRequest function. Can anyone see where the problem lies, it has been turning me crazy all weekend already.

View 12 Replies View Related

XMLHttpRequest() In FF Not In IE?

Jul 6, 2010

1. - I am new to this
2. - Using the following .js file:

Code:
function makeObject(){
var x;
if (window.ActiveXObject) {
x = new ActiveXObject("Microsoft.XMLHTTP");
}else if (window.XMLHttpRequest) {
x = new XMLHttpRequest();
}
[Code]...

View 7 Replies View Related

XmlHTTPRequest Problem

Sep 12, 2005

Ive been playing around with xmlHTTPRequest and was wondering if i was
programming a part of my code wrong.

what i want to do is have the browser access another part of my site
using xmlhttprequest.

however, when i use xmlhttp.open("POST",
'http://xml.mysite.com/test.php')
it fails, but if i use xmlhttp.open("POST",
'http://www.mysite.com/test.php') it works. Is access to another url
restricted in xmlhttp?

View 4 Replies View Related

XMLDocument And XMLHttpRequest ?

Dec 29, 2005

I have something like this:

var xmlDoc=document.implementation.createDocument("", "", null);

but in opera xmlDoc.load(...) won't work, so I use:

XMLHttpRequest, and I have all needed code... let's say it works...

So I got serviceRequest.responseXML and is there a way to initialize xmlDoc
in my case ? I am asking because I have code that uses xmlDoc.load(...) in
FF and all code that's need to futher work with XML written. So this would
be comfortable for me to use xmlDoc instead of creating everything from
start.

View 4 Replies View Related

? In XMLHttpRequest.ResponseText

Feb 25, 2006

I'm fetching some HTML files with XMLHttpRequest and dumping the
ResponseText into block elements; works fine except that single and double
quotes are being displayed as question marks (inside of a black diamond in
FireFox)

What's going on ? What is the workaround ? I've tried this:

divElement.innerHTML = x.responseText.replace(/?/g, "'")

but it does nothing ... even if it did work it would not be distinguishing "
from '

View 11 Replies View Related

XmlHttpRequest Is Not Working

Jan 19, 2007

I would like to use the xmlhttprequest-object to send an http request
to my server. The http request is used to switch the light on through
home automation.

However it's not working, and I can't find the problem.

Could it be that the apache-server is located on 192.168.0.21 and that
the http request is sent to 192.168.0.21:8080?

View 6 Replies View Related

Xmlhttprequest Object

Apr 24, 2005

function XML_request(func) {

var onreadystatechange= func;
this.method = "GET";
this.get = function(url) {

var request = null;
var state_change = function() {
if (request.readyState==4) {
if (request.status==200) {
onreadystatechange(request);
} else {
return null;
}
}
}

try {
request = new XMLHttpRequest();
} catch(e) {
try {
request = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
return null;
}
}
if (request===null) {
return null;
}
request.onreadystatechange = state_change;
request.open(this.method, url, true);
request.send(null);
}
}
var req = new XML_request(function(response) {
response = response.responseXML
alert(response.getElementsByTagName('blah')[0].firstChild.data);
});

req.get('index.php?mode=blah&a=response')



i didn't like the examples I found so this is suitable.. I only tested in ie and firefox though.. so let me know what I may be missing.. or criticism in general.

View 9 Replies View Related

XMLHTTPRequest Compatibility

Oct 26, 2005

I'm working on an application that uses ajax and we are going to have a version that people with browsers that don't support the XmlHttpRequest object. My problem is what's the best way to check this.

I have tried the following

var xmlreq = new new XMLHttpRequest();
if (!xmlreq){
// handle the browser stuff
}

In netscape 4.7 this results in an error that I don't seem to be able to recover from and I don't think this is the best approach to this problem.

View 2 Replies View Related

Getting XMLHttpRequest Status=0 Or XMLHttpRequest Status=406?

Sep 11, 2011

While accessing my web service i am getting XMLHttpRequest status=0 in Crome/Mozilla and in IE getting XMLHttpRequest status=406. What is the solution for it so that i will successfully get responseText from server? I have tried accessing my html code with localhost but its getting same error,while when i run my code in that localhost location through local drive then it's working. why this is happning i didn't get?

View 1 Replies View Related

Execute After XMLHttpRequest?

Feb 3, 2010

I got a javascript function to pull contents from a php page, let's call this page B to the actual page, let's call this page A.

As I know when a page gets loaded the javascript on that page won't execute, am I right?

Now I need the javascript code on that page B to get executed. Is that somehow possible?

View 1 Replies View Related







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