Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Javascript XMLHttpRequest unter Win CE

Empfohlene Antworten

Veröffentlicht

Hallo,

Fall: Ein Mobiler Barcodescanner mit Win CE und IE portable(6) kommuniziert mit einem Webserver über HTTP mit xmlhttpRequests, sollte keine Kommunikation mehr zum Webserver bestehen =>alert(zurück ins WLan):

Im FF und IE auf den Desktopmaschienen funktioniert mein kleines Skript wunderbar.

SObald es auf win ce (meines erachtens IE6) ausführe geht die xhr(xmlhttprequest).open('GET', url, true)

nicht.

Das heisst ich kann mit dem xhr nicht nach dem Sttatus 4 abfragen weil die DAtei die gelesen werden soll nie gelsen wird und somit nie der Status 4 erreicht wird.

Hoffendlich kann mir einer helfen.... Zeitdruck=Stress!

Bin für jede Idee dankbar.

Hier der Code:

<html>

<head>

<script type="text/javascript">

var xhr = false;

var wlan_timeout;

var wlan_access = true;

if (typeof XMLHttpRequest != 'undefined')

{

xhr = new XMLHttpRequest();

}

if (!xhr)

{

try

{

xhr = new ActiveXObject("Msxml2.XMLHTTP");

}

catch(e)

{

try

{

xhr = new ActiveXObject("Microsoft.XMLHTTP");

}

catch(e)

{

xhr = null;

}

}

}

function startConnCheck()

{

alert('aufi');

testConnection();

}

function aktivateTimer()

{

wlan_timeout = setTimeout("WLanMsg()", 25000);

}

function testConnectionDelay()

{

clearTimeout(wlan_timeout);

wlan_timeout = setTimeout("testConnection()", 5000);

}

function WLanMsg()

{

alert('Ins WLAN du Ochse!');

testConnectionDelay();

}

function testConnection()

{

xhr.onreadystatechange = handleContent;

xhr.open('get','/pub/wlancheck.html',true);

xhr.send(null);

return false;

}

function handleContent()

{

if(xhr.readyState == 0 || xhr.readyState == 1 )

{

clearTimeout(wlan_timeout);

aktivateTimer();

}

else if( xhr.readyState == 4 ){

if(wlan_access == false){

alert('Wieder WLAN Verbindung!');

}

wlan_access = true;

testConnectionDelay();

}

return false;

}

</script>

</head>

<body onload="startConnCheck()">

<p>blablatest</p>

<p id="myContent">

<a href="#" onclick="testConnection();">Klick mich</a>.

,ich will zu hugo

</p>

</body>

</html>

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.