TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
praveen rapelli
NA
28
39.7k
Call webservice in html javascript which works all browsers(on internet )
Jun 21 2011 6:33 AM
<html>
<head>
<title>Consume Count Service</title>
<script type="text/javascript" language="javascript" >
function outputResult(str){
var xmlhttp = null;
alert(xmlhttp);
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
if ( typeof xmlhttp.overrideMimeType != 'undefined') {
xmlhttp.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} else {
alert('Perhaps your browser does not support xmlhttprequests?');
}
str='modi';
flag='s';
var url= "http://example.com/webservice.asmx/webmethodname?prefixText="+str+"&flag="+flag;
xmlhttp.open('GET', url, true);
xmlhttp.send(null);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
// do something with the results
} else {
// wait for the call to complete
}
};
var myString=xmlHttp.responseText;
}
</script>
</head>
<body onload="outputResult(this.value)">
</body>
</html>
Question:
This is not working in firefox,opera,internet explorer..etc in online(internet).It works perfectly in local system.How to solve this problem,please tell me........
Reply
Answers (
4
)
webservice in aps.net
How to call webservice using html javascript which supports all browsers