balkan7 Posted January 14, 2009 Share Posted January 14, 2009 please help me data from clicked link. radio_panel.php <?php echo "<script type='text/javascript' src='radio.js'></script>"; openside("Radio"); echo "<table width='100%' cellpading='0' cellspacing='0' class='center'>\n<tr>\n"; echo "<td class='tbl1' witdh='50%'>Domasni</td>"; echo "<td class='tbl1' witdh='50%'><a href=\"javascript: page('stranski')\">Stranski</td>\n</tr>\n<tr>"; if (isset($_GET['page']) == "stranski"){ echo "<td class='tbl'><div id='radio'>Stranski radio stanici</div></td>"; } else { echo "<td class='tbl'>Domasni radio stanici</td>"; } echo "<tr>\n</table>\n"; closeside(); ?> and radio.js function getHTTPObject() { var xmlhttp; if(window.XMLHttpRequest){ xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject){ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); if (!xmlhttp){ xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } } return xmlhttp; } var http = getHTTPObject(); // We create the HTTP Object /* */ function page(radio) { http.abort(); http.open("GET", "radio_panel.php?page=" + radio, true); http.onreadystatechange = function() { if(http.readyState == 1) { // Loading indicator document.getElementById('radio').innerHTML = '<img src=\"images/loading.gif\">'; } if(http.readyState == 4) { document.getElementById('radio').innerHTML = http.responseText; http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", param.length); http.setRequestHeader("Connection", "close"); } } http.send(null); } Quote Link to comment Share on other sites More sharing options...
xtopolis Posted January 15, 2009 Share Posted January 15, 2009 It looks like you're using POST headers http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", param.length); http.setRequestHeader("Connection", "close"); with a GET request. What happens if you remove those lines? Quote Link to comment Share on other sites More sharing options...
balkan7 Posted January 15, 2009 Author Share Posted January 15, 2009 i change js code but nothing happens ??? radio.js var XMLHttpRequestObject = false; if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest(); } else if (window.ActiveXObject) { XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP"); } function radio(page, DivID) { if(XMLHttpRequestObject) { var obj = document.getElementById(divID); XMLHttpRequestObject.open("GET", "radio_panel.php?page=" + page, true); XMLHttpRequestObject.onreadystatechange = function() { if(XMLHttpRequestObject.readyState == 1) { // Loading indicator obj.innerHTML = '<img src=\"images/loading.gif\">'; } if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { obj.innerHTML = XMLHttpRequestObject.responseText; } } XMLHttpRequestObject.send(null); } } and html <a href=\"javascript:radio('strasnki', 'show');\">Stranski</a> <div id='show'>show here!!!</div> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.