Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
Posts: 4
Registered: ‎12-21-2010
My Device: Not Specified

Re: Problem to post data to php file in widget.

i developed a widget and it is working fine in blackberry 5.0 and 6.0, but not working in 4.6 and below please i want to know how to make this code work in this versions.

 This is my index.html

 

 

<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function showCD()
{
 var queryString = window.top.location.search.substring(1);
 var str=queryString;
if (str=="")
  {
  document.getElementById("showdiv").innerHTML="";
  return;
  } 
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("showdiv").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","http://www.mydomain.com/textrequest.php?state="+str,true);
xmlhttp.send();
}
</script>
</head>
<body onLoad="showCD();">
<div id='showdiv' style='margin-top:-1px;'></div>
</body>
</html>