Advertisement
Advertisement
| 03.19.2008 at 11:33AM PDT, ID: 23254688 | Points: 100 |
|
[x]
Attachment Details
|
||
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: |
function saveAJAX(){
var xmlhttp = false;
var async = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
async = true;
}
xmlhttp.open("post", getAttribute(sForm, "action"), async);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4) {
document.location.reload();
}
}
xmlhttp.send(getFormData());
}
|
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 03.28.2008 at 09:12PM PDT, ID: 21235505 |
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: |
function ajax_createXmlHttpRequestObject() {
// create new XMLHttpRequest Object
xmlHttp == false;
// will store the reference to the XMLHttpRequest object
// this should work for all browsers except IE6 and older
try {
// try to create XMLHttpRequest object
xmlHttp = new XMLHttpRequest();
}
catch(e) {
// failed to create XMLHttpRequest object
// assume IE6 or older
var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0",
"MSXML2.XMLHTTP.5.0",
"MSXML2.XMLHTTP.4.0",
"MSXML2.XMLHTTP.3.0",
"MSXML2.XMLHTTP",
"Microsoft.XMLHTTP");
// try every prog id until one works
for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++) {
try {
// try to create XMLHttpRequest object
xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
}
catch (e) {}
// failed to create object
// do nothing and try the next
}
}
// return the object
// returns false if we were unable to create any object
return xmlHttp;
}
|
| 03.28.2008 at 09:40PM PDT, ID: 21235560 |
| 03.29.2008 at 07:05AM PDT, ID: 21236576 |
| 03.29.2008 at 07:05PM PDT, ID: 21239209 |
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: |
function saveAJAX(){
var xmlhttp = false;
var async = false;
/*@cc_on @if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
xmlhttp.open("post", getAttribute(sForm, "action"), async);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
xmlhttp.send(getFormData());
if (xmlhttp.readyState==4) {
document.location.reload();
}
}
|
| 03.30.2008 at 08:02AM PDT, ID: 21240911 |