Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


IE6, Javascript client storage and ajax.

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

Phil.
World Chat Champion



Joined: 02 Feb 2002
Karma :

PostPosted: 18:39 - 20 Feb 2012    Post subject: IE6, Javascript client storage and ajax. Reply with quote

Hi

I have a problem with unreliable wifi and a handheld barcode scanning device that runs Windows mobile 6.1.

My idea was to have a html file and prototype library on the device and ajax the scans, storing the information client side and if the ajax fails it will just keep trying till the network is back up on the device.

I'm not very familiar with storing information client side. I was going to resort to dropping cookies to store the scans and delete them on a successful ajax call. But if anyone has any IE6 safe suggestions I'd be happy to hear them.

Thanks
 Back to top
View user's profile Send private message Visit poster's website You must be logged in to rate posts

Kickstart
The Oracle



Joined: 04 Feb 2002
Karma :

PostPosted: 20:12 - 20 Feb 2012    Post subject: Reply with quote

Hi

I would be inclined to give up on a mobile page like that. I you must on an old pda browser like that it will be a pig to do. Cookies sounds possible but messy once you get through to needing more than the od thing stored.

Better would be to write a windows mobile app which stores to a local db and sync that when possible.

All the best

Keith
____________________
Traxpics, track day and racing photographs - Bimota Forum - Bike performance / thrust graphs for choosing gearing
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Phil.
World Chat Champion



Joined: 02 Feb 2002
Karma :

PostPosted: 20:26 - 20 Feb 2012    Post subject: Reply with quote

If I could, I would write a mobile app for it but I'm limited by my own skills and time to learn at the moment.

I have to make do with the browser on the thing. Javascript isn't my strong point but I was hoping there may be a way of storing things in an easier way than cookies. But I don't want to spend long on this (IE6) so I will make do with what I know so I can move on I think.

Thanks
 Back to top
View user's profile Send private message Visit poster's website You must be logged in to rate posts

Kickstart
The Oracle



Joined: 04 Feb 2002
Karma :

PostPosted: 20:40 - 20 Feb 2012    Post subject: Reply with quote

Hi

The barcode scanning is the difficult bit with the mobile app (done this at work a bit), although just scanning to the current input field should be easy. The web communication is the easy bit.

Cookies do sound a bit clunky but my concern would be losing data due to them expiring before being sent to the server. Should be easy enough, except for the really annoying habit the old Windows pdas have of wiping the memory when the battery goes flat.

All the best

Keith
____________________
Traxpics, track day and racing photographs - Bimota Forum - Bike performance / thrust graphs for choosing gearing
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Jayy
Mr. Ponzi



Joined: 08 Jun 2009
Karma :

PostPosted: 23:49 - 20 Feb 2012    Post subject: Reply with quote

I flat out don't support IE6 anymore. I refuse to support a 10+ year old browser for a minority of about 2 people per month visiting sites on it.

I know that isn't a solution to your problem and the client probably dictated the IE6 support but just thought I would throw it in there. I will however do it if they pay for it.
 Back to top
View user's profile Send private message You must be logged in to rate posts

Kickstart
The Oracle



Joined: 04 Feb 2002
Karma :

PostPosted: 23:56 - 20 Feb 2012    Post subject: Reply with quote

Hi

Tend to agree with desktop browsers, but with the old PDAs you are pretty much stuck, and most places don't want to dump an expensive fairly resilient piece of hardware

All the best

Keith
____________________
Traxpics, track day and racing photographs - Bimota Forum - Bike performance / thrust graphs for choosing gearing
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Phil.
World Chat Champion



Joined: 02 Feb 2002
Karma :

PostPosted: 10:35 - 21 Feb 2012    Post subject: Reply with quote

I did install opera mobile 10 on the device but it has some interesting behaviour with text input which makes it harder to work with than IE6 if you can believe that.

I'm just thankful of JavaScript libraries to make ajax possible.

Never the less, today is going to suck.

Edit, today indeed did suck;

Code:

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="prototype.js"></script>

<script type="text/javascript">
            function ajax_call(name,parameters){
                var myAjaxx = new Ajax.Updater(name,

'http://www.xxxxxxxx.com', {
                    method: 'post',
                    parameters: parameters,
                    onFailure: function (oXHR) {
                        $(name).update('Error');
                    },
                    onLoading: function (oXHR) {
                        $(name).update('');
                    },
                    onSuccess: function(oXHR) {
                        $(name).update(oXHR.responseText);
         success();
                    }
                });
            }

var oTextbox, timer;

window.onload = function()
{
   oTextbox = document.getElementById("order_id");

   oTextbox.onkeyup = function()
   {
      if(timer) window.clearTimeout(timer);
      
      timer = window.setTimeout('process_input()', 1000);
   }
}

function success(){
   $('stored_ids').value = '';
}

function process_input(){
   
   var timestamp = Number(new Date());
   var oid = $F('order_id') + '_' + timestamp + ':';
   var currently_stored_ids = $F('stored_ids');

   $('stored_ids').value = currently_stored_ids+oid;
   ajax_call('ajax_div','oids=' + $F('stored_ids'));

   $('order_id').value = '';
}

</script>


<title>IE Sucks</title>
</head>
<body>

<form>
<input type="text" name="order_id" id="order_id" value="" autocomplete="off" />
<br />
<input type="text" name="stored_ids" id="stored_ids" value="" />
</form>




<div id="ajax_div">

</div>


</body>


</html>


One thing i learned, Firefox doesn't like ajax calls to a different hostname. So absolute uris are impossible. However I guess IE uses Active x so it doesn't mind, which is a bonus and the ajax functions in prototype keep on working.
 Back to top
View user's profile Send private message Visit poster's website You must be logged in to rate posts

Jayy
Mr. Ponzi



Joined: 08 Jun 2009
Karma :

PostPosted: 00:34 - 22 Feb 2012    Post subject: Reply with quote

I've come across the same thing with Firefox and a different host, doesn't like it one bit.
 Back to top
View user's profile Send private message You must be logged in to rate posts

Kickstart
The Oracle



Joined: 04 Feb 2002
Karma :

PostPosted: 00:38 - 22 Feb 2012    Post subject: Reply with quote

Hi

One possible way around the domain issue is to have a hidden iframe with the source from the right domain and pass data to and from that using messaging.

All the best

Keith
____________________
Traxpics, track day and racing photographs - Bimota Forum - Bike performance / thrust graphs for choosing gearing
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts
Old Thread Alert!

The last post was made 14 years, 52 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.06 Sec - Server Load: 1.48 - MySQL Queries: 13 - Page Size: 67.18 Kb