|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by symbian-user in Symbian Handheld Operating System, CodeWarrior, JavaScript
I want to get html page from server with modified user-agent... Any ideas please...))) i have found one solution
http://www.youtube.com/watch?v=qr1T9fze_f4 but it is only for cracked mobiles...and needed restart mobile or brouser((( Also i have tried to create XMLHttpRequest and then setRequestHeader("User-Age
nt",...) but in fact it doesn't change user-agent string((((((((
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
|
<script type="text/javascript" language="javascript">
function createRequest() {
...
}
function loadHttpRequest(url) {
//This code works fine on WIndows but on Symbian emulator doesn't change User-Agent string
try {
var xmlhttp = createRequest();
xmlhttp.open("GET", "http://ip.xss.ru/header.php", true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
try {
if (!xmlhttp.status || xmlhttp.status == 200) {
alert("Navigate complete:\r\n" + xmlhttp.responseText);
document.write(xmlhttp.responseText);
}
} catch (e) {
alert(e.message || e);
}
}
};//onreadystatechange
xmlhttp.setRequestHeader("User-Agent", "Test Agent String");
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send(null);
} catch (e) {
alert(e.message || e);
}
}
</script>
|
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625